[API-321] Migrate tests for blast writes#342
Merged
Conversation
schottra
commented
Aug 26, 2025
| ($1, $2, $3, $4, $5) | ||
| on conflict do nothing | ||
| `, trashid.BlastMessageID(blast.BlastID, params.ChatID), params.ChatID, blast.FromUserID, blast.CreatedAt, blast.BlastID) | ||
| `, messageId, params.ChatID, blast.FromUserID, blast.CreatedAt.UTC(), blast.BlastID) |
Contributor
Author
There was a problem hiding this comment.
Note here the usage of .UTC(). On my machine, when running this, the location() on this time.Time was being set to Local and that was causing us to insert messages in the past. Since chat_blast uses a timestamptz column type and chat_message uses a plain timestamp column type, pgx semantics when inserting will cause it to try and map from the timezone in the incoming variable to the timezone of the machine running postgres.
Kind of gnarly 😬
raymondjacobson
approved these changes
Aug 28, 2025
| }) | ||
| } | ||
|
|
||
| /* TODO: |
Contributor
Author
There was a problem hiding this comment.
I didn't think writing them would add a ton of value for the amount of time it would take. Can be persuaded though :-p
schottra
added a commit
that referenced
this pull request
Aug 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a followup to #338 to migrate the quite sizable blasts test file. Source is here: https://github.com/AudiusProject/audius-protocol/blob/ab73d979f98e151ac0aa408c7a82c105c3b6355e/comms/discovery/rpcz/chat_blast_test.go#L760
getNewBlastsin the comms directory to match the one we use in the get endpoint. We are being intentionally WET here.As a bonus, also cleaned up the tests from the previous PR to match the patterns here.