Repository navigation
chat: failing test for a sender-key miss stored as a permanent unbox error - #29842
Draft
chrisnojima wants to merge 1 commit into
Draft
chrisnojima wants to merge 1 commit into
chrisnojima wants to merge 1 commit into
Conversation
… error and never retried
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 PR contains only a failing test. It pins a chat service bug so the fix can land on its own. Expect CI's
go/chatrun to go red here until that fix lands.Summary
If the reader's cached view of the sender doesn't yet have the sender's device key, the message is stored as a permanent error. It stays that way after the reader learns the key.
TestChatMessageUnboxSenderKeyMissIsNotPermanent(go/chat/boxer_sender_key_test.go) unboxes a canned V1 message. Its fake UPAK finder reports the sender's key as unknown until the test "learns" it:It needs no kbweb: there's no signup, and the real
ValidSenderKeyruns.Evidence
NewPermanentUnboxingErrortoNewTransientUnboxingErrorat that line makes the test pass. TheTestV1Message*tests still pass with that change (it was not committed).gofmtclean;golangci-lint --new-from-revreports 0 issues.Run:
cd go && go test ./chat/ -run TestChatMessageUnboxSenderKeyMissIsNotPermanent -count=1Fix options (for the follow-up, not in this PR)
CheckKIDForUIDmiss as transient. This is the smallest change, butBoxer.UnboxMessagesaborts the whole batch on a transient error. If the key really is missing, the thread pull would stay blocked.CheckKIDForUIDskips the forced reload when the first load touched the leaf or the user. Only a miss that survives the reload becomes an error.UserChanged, so the next fetch unboxes them again.Options 2 and 3 combine: reload first, and never cache the miss as final.
A storage-level test isn't possible without kbweb.
Storage.Merge/FetchneedGetSecretBoxKey, which needs a signed-up user. This test pins the classification step that starts the chain.Merge Danger
Door: two-way
Test-only. Merging it alone turns
go/chatred until a fix lands, so it should land together with the fix or after it.Blast Radius: go-chat-tests