Repository navigation
Accept explicit application contexts for named stores - #50
Open
LucaCappelletti94 wants to merge 1 commit into
Open
LucaCappelletti94 wants to merge 1 commit into
LucaCappelletti94 wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
LucaCappelletti94
force-pushed
the
upstream/explicit-application-context
branch
from
October 21, 2026 20:07
4722b75 to
5a985c7
Compare
LucaCappelletti94
force-pushed
the
upstream/explicit-application-context
branch
from
October 22, 2026 07:35
5a985c7 to
55bb025
Compare
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.
Named stores accept a caller-supplied application context for construction, existence checks and deletion without initializing
ndk-context, addressing #49. Credential-protected and device-protected stores remain separate.My real use case is a background FCM data-only message arriving after Android has reclaimed the application process. Android can start the service without an activity, and the handler may need a stored key to decrypt the message and render a notification before the user opens the app. The service already has an application context while the UI framework's
ndk-contextinitialization may not have run at all.The test starts
ExplicitContextServicedirectly to reproduce that startup ordering without depending on FCM delivery. The service writes and reads a credential fixture, thenMainActivityinitializesndk-contextand the store suite reads the same credential, representing the user opening the app afterward. The runner's token and bounded waits correlate these phases, andcontext-testedprevents fixture recreation in the activity.