scouting: Fix timestamp issue during action submission
The newly deployed scouting app was giving users these kinds of
errors:
Received 500 Internal Server Error: "Failed to add action to
database: ERROR: null value in column "time_stamp" of relation
"actions" violates not-null constraint (SQLSTATE 23502)"
The issue was that the database was created with the
`Action.TimeStamp` field. This was the spelling from the action
submission patch I cherry-picked a long time ago. Later, as the action
submission patch made its way onto master, the spelling changed to
`Action.Timestamp`. This means that a database that was already
created cannot be used by both versions of the software.
Since the database already used the `TimeStamp` spelling, I am
changing the code here to match. For next year, we should settle on a
spelling and fix it.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I776724e740556ff8267d7a68be5111793b4574db
diff --git a/scouting/webserver/requests/requests.go b/scouting/webserver/requests/requests.go
index 8293fa2..e5b4680 100644
--- a/scouting/webserver/requests/requests.go
+++ b/scouting/webserver/requests/requests.go
@@ -834,7 +834,7 @@
CompLevel: string(request.CompLevel()),
//TODO: Serialize CompletedAction
CompletedAction: []byte{},
- Timestamp: action.Timestamp(),
+ TimeStamp: action.Timestamp(),
CollectedBy: username,
}
diff --git a/scouting/webserver/requests/requests_test.go b/scouting/webserver/requests/requests_test.go
index d68dd61..9a07726 100644
--- a/scouting/webserver/requests/requests_test.go
+++ b/scouting/webserver/requests/requests_test.go
@@ -869,7 +869,7 @@
CompLevel: "qual",
CollectedBy: "debug_cli",
CompletedAction: []byte{},
- Timestamp: 2400,
+ TimeStamp: 2400,
},
{
PreScouting: true,
@@ -879,7 +879,7 @@
CompLevel: "qual",
CollectedBy: "debug_cli",
CompletedAction: []byte{},
- Timestamp: 1009,
+ TimeStamp: 1009,
},
}