Repository navigation
Conversation
Parse DIRECTIONAL_SPLIT, DIRECTIONAL_MERGE, THRESHOLD_COMPOSE and THRESHOLD_DECOMPOSE rows, and keep unknown future types as UnknownActivity so a new type cannot fail the page. Co-authored-by: Jeremy Wei <jwei-pm@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 97ae29b. Configure here.
Zero-padded 32-byte event ids are not market conditions. Keep UnknownActivity.conditionId unset for both the 29-byte form and the padded form already served on directional rows. Co-authored-by: Jeremy Wei <jwei-pm@users.noreply.github.com>
Author
|
Closing: not needed for the current staging work. |
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.

The Data API now serves four range-event activity types from DirectionalModule (module 4). A strict
ActivityTypeenum rejected those rows and failed the whole activity page.This change adds the four types and keeps unknown future types as
UnknownActivity, so a new type cannot crash clients.Types
DIRECTIONAL_SPLIT/DIRECTIONAL_MERGE: event-level rows.sizeis pair count (pairs).usdc_sizeis collateral paid or returned (amount).condition_idon the wire is the event id, not a market. Metadata (title,eventSlug,icon) is optional until the event is listed.THRESHOLD_COMPOSE/THRESHOLD_DECOMPOSE: line-market rows.conditionIdis required.sizeis share count (shares).usdc_sizeis 0.outcome/outcomeIndexname the line side when present (0 = Yes/ABOVE, 1 = No/BELOW).Source of the wire contract: polymarket-indexer
/v2activity serving and the DirectionalModule event semantics (split/merge of two lines, compose/decompose of one line).Unknown types
ActivitySchemaaccepts any non-emptytypestring. Types that are not inActivityTypeparse asUnknownActivitywithtype: undefinedand the served value inrawType. Exhaustive switches overactivity.typeneed a branch forundefined.The
listActivitytypefilter still accepts only knownActivityTypevalues.Tests
Sample payloads cover each new type, empty listing metadata, 29-byte and padded event ids, a missing threshold
condition_id, and a mixed page that includes an unknown type.Note
Medium Risk
Changes core activity normalization and widens the
Activityunion, so downstream type narrowing and display logic must handle new variants and unknown rows; market vs eventcondition_idhandling is easy to get wrong if ignored.Reviewed by Cursor Bugbot for commit da77d9e. Bugbot is set up for automated code reviews on this repo. Configure here.