feat: tier pushes by urgency and group them per session - #238
Merged
Merged
Conversation
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.
What and why
Every push looked and sounded the same, so an agent waiting on an answer was buried among routine completions, and two sessions in one repo were indistinguishable. Pushes now carry an urgency level and a per-session grouping.
urgent; done ->quiet; anything else ->normal).notifygains an optional--session;stateandholdset the session and level themselves.time-sensitive, sound, relevance 1. normal:active, sound. quiet:passive, no sound. Setsthread-idfrom an opaque key when given.threadIdentifierwhen the relay supplied none, and re-states interruption level / relevance so the extension does not flatten them.Cleartext vs ciphertext
session,level.levelandthreadKey, a truncated SHA-256 of host label + session name. The relay setsthread-idfrom that opaque key; the session name never reaches it. The NSE sets the readable subtitle from the decrypted payload.base64(nonce[12] || ciphertext || tag[16])is unchanged.Backward compatibility
normaland omitsthread-id; a malformed thread key is dropped rather than rejecting the push. Note thatnormalnow addsinterruption-level: active, which matches iOS's default.session/levelleave the NSE behaviour unchanged.Follow-up
The
com.apple.developer.usernotifications.time-sensitiveentitlement is deliberately not added: it needs an App ID capability change in the Apple developer portal first and would break release signing. Until then iOS delivers time-sensitive pushes as active. Enabling it is a separate change.Verification
go build,go vet,go testinapps/tether-notify(new tests: level derivation, thread key stability/opacity, relay request body, session/level on state and hold pushes).bun testand typecheck (new tests: schema defaulting, per-level envelope, thread-id, end-to-end request).bun run lint.