Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip loading invalid targets #7018

Closed
wants to merge 1 commit into from
Closed

Conversation

schmidt-sebastian
Copy link
Contributor

@schmidt-sebastian schmidt-sebastian commented Nov 24, 2020

This addresses a crash during LRU by simply ignoring targets that cannot be deserialized. We could possibly be smarter about this as we only need the Target ID and the LastListenSequenceNumber to determine what targets to delete, but this for now is the more targeted fix.

Fix: #6721

// In https://github.com/firebase/firebase-ios-sdk/issues/6721, a customer
// reports that their client crashes with an invalid Target proto. Instead
// of crashing the client, we skip the target during LRU GC.
// TODO: Evaluate whether it makes sense to proceed if we can determine
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use TODO(username) or TODO(bug) to give context.

A way to achieve the stated goal would be to just avoid the call to decoding the target altogether. If the message fails to even parse, we could synthesize a message with an invalid sequence number that the caller could know to delete. That's probably a bigger change than you want to undertake for this specific fix, so feel free to avoid overhauling this interface for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I will try to fix these targets in a separate PR now.

@schmidt-sebastian
Copy link
Contributor Author

Closing in favor of #7018

@firebase firebase locked and limited conversation to collaborators Dec 31, 2020
@paulb777 paulb777 deleted the mrschmidt/skiptargets branch September 2, 2022 22:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empty orderBy field path when retrieving cached query from LevelDB
4 participants