feat: expose user state (done, starred) on TimelineEvent#104
Open
mhlavac wants to merge 1 commit intoEdupageAPI:masterfrom
Open
feat: expose user state (done, starred) on TimelineEvent#104mhlavac wants to merge 1 commit intoEdupageAPI:masterfrom
mhlavac wants to merge 1 commit intoEdupageAPI:masterfrom
Conversation
Add 6 new fields to TimelineEvent populated from userProps data that Edupage already returns but the library was discarding: - is_done / done_at: whether the user dismissed the item and when - is_starred: whether the user starred/pinned the item - reaction_count: number of reactions on the item - created_at: original creation timestamp (distinct from display timestamp) - is_removed: soft-delete flag The userProps data is keyed by timeline ID and available in: - edu.data["userProps"] (from login cache, used by get_notifications) - response["timelineUserProps"] (from history endpoint, used by get_notifications_history) All new fields have default values so existing code is unaffected. Also adds the first unit tests for the timeline module (30 tests). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
TimelineEventpopulated fromuserPropsdata that Edupage already returns but the library was discarding:is_done/done_at— whether the user dismissed/completed the item and whenis_starred— whether the user starred/pinned the itemreaction_count— number of reactions (likes) on the itemcreated_at— original creation timestamp (distinct from displaytimestamp)is_removed— soft-delete flag from raw event dataHow it works
Edupage stores per-user item state in two places:
edu.data["userProps"]— available from the login cache (used byget_notifications())response["timelineUserProps"]— returned by the history API endpoint (used byget_notifications_history())Both are dicts keyed by timeline ID containing
{"starred": "1"}and/or{"doneMaxCas": "2025-03-10 14:30:00"}. The library was already receiving this data but discarding it.Additional raw event fields (
pocet_reakcii,cas_pridania,removed) were also being discarded and are now exposed.Test plan
is_done/done_atconsistency:is_doneis derived fromdone_at is not NoneTimelineEventwith only the original 7 positional args works🤖 Generated with Claude Code