Surface the notification tag, and the facts packed into notification_id - #354
Open
dchaudhari7177 wants to merge 1 commit into
Open
Surface the notification tag, and the facts packed into notification_id#354dchaudhari7177 wants to merge 1 commit into
dchaudhari7177 wants to merge 1 commit into
Conversation
ccl parses a notification's developer tag and its notification_id, and
get_platform_notifications used neither, so both were dropped. The tag is the
slot a site overwrites -- Google Calendar reuses event-notification for every
reminder -- so without it six rows from one recurring channel look exactly like
six unrelated alerts, which is the question the output could not answer.
Tag is now a value row. notification_id is decoded rather than printed raw:
p#https://calendar.google.com/#1event-notification
|| |
|| +- 0 = notification id, 1 = developer tag
|+- b browser-raised, # page-raised
+- p persistent, n non-persistent
giving Persistent and Raised By rows. The id's own value is emitted only when
it is a notification id, since when it is a developer tag the Tag row already
says it.
decode_notification_id returns None for anything that does not match rather
than guessing, and the caller then prints the id whole -- so a format change
costs the decoded rows but never the data.
persistent_notification_id is emitted when populated. It was None throughout
the sample, so this may never fire; guarding on truthiness costs nothing and
means it appears the day it does.
Tests cover the real corpus id from bf4sa_2026_bob-2, the browser-raised and
non-persistent variants, an origin containing a hash, an empty tag, and ten
shapes that must decode to None.
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.
Closes #333.
The decision the issue leaves open
Decoded parts, with the raw id as the fallback. A row reading
p#https://calendar.google.com/#1event-notificationasks the reader to decode it by hand every time, and the origin is already the record's URL and the tag is already its own row — so most of that string is a restatement. The parts that are not said anywhere else are persistence and who raised it, so those become rows:The id's own value is emitted only when the type digit says
0(notification id). When it says1the value is the tag, and the Tag row already has it.When the string does not decode,
decode_notification_idreturnsNoneand the caller prints the id whole. So a future format change costs the decoded rows but never the data — which is the reason it returnsNonerather than guessing at the parts it can see.persistent_notification_idThe issue asks to confirm it is ever populated before spending a row on it. I could not: it is
Nonethroughout the sample here too, exactly as reported. It is emitted only when truthy, so it costs nothing today and appears the day it is populated rather than needing a second PR.Verified
tests/test_notification_id.py. Red before green, with onlychrome.pystashed:Covering:
bf4sa_2026_bob-2— decodes to persistent, page-raised, developer tagevent-notification, which agrees with what ccl parses independentlynandbvariants, which the corpus does not contain#characters —partition()splits on the first, and the test pins that rather than leaving it to chanceNone: too short, unknown persistence flag, unknown raiser flag, no separator, separator with nothing after it, unknown type digit, and an opaque handleFull suite: 253 passed, 2 skipped, 90 subtests (up from 248/2/80, all new).
Scope
The
Tag:line is the whole fix for the common case, as the issue says. The decoder is 30 lines and pays for itself in the two flags the tag cannot give you — but if you would rather ship only the tag and leave the id alone, the decoder is one self-contained static method and its tests, and I will drop it.