-
Notifications
You must be signed in to change notification settings - Fork 0
docs: update ProtocolAddress and session locking for inline-SSO refactor (whatsapp-rust#1131) #447
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still says the hot-path
session_lockskey is produced byto_protocol_address_string(), but the inline-SSO refactor uses reusableProtocolAddressvalues as the lock-cache keys; otherwisesession_guards_for()could not avoid constructing a string key. The same stale model remains inconcepts/architecture.mdx, which declaresCache<String, ...>, and inconcepts/storage.mdx. Update these descriptions and snippets to the new key type so readers are not given the pre-#1131 allocation and cache behavior.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This premise doesn't hold — I checked against
whatsapp-rust@main:session_locksis stillCache<String, Arc<Mutex<()>>>(src/client.rs:1000), unchanged by #1131.session_lock_for(signal_addr_str: &str)(src/client/adapters.rs:38) callsself.session_locks.get_with_by_ref(signal_addr_str, ...)—get_with_by_refonly allocates an ownedStringkey on a cache miss; on a hit it takes&strand allocates nothing. That's what letssession_guards_for()passaddr.as_str()(from a reusedProtocolAddress) without constructing a string key, with no need for the cache itself to be keyed byProtocolAddress.This isn't new either —
get_with_by_refalready existed at #1131's base commit (1118084), so it predates the inline-SSO refactor entirely. The docs'Cache<String, ...>declaration inconcepts/architecture.mdxand theto_protocol_address_string()description inadvanced/signal-protocol.mdxare accurate as written. No change needed here.Generated by Claude Code