Skip to content

feat: normalize manage_data into data.set / data.cleared events#256

Open
Geff115 wants to merge 3 commits intodetermined-001:mainfrom
Geff115:feat/normalize-manage-data
Open

feat: normalize manage_data into data.set / data.cleared events#256
Geff115 wants to merge 3 commits intodetermined-001:mainfrom
Geff115:feat/normalize-manage-data

Conversation

@Geff115
Copy link
Copy Markdown

@Geff115 Geff115 commented Apr 28, 2026

Closes #78

What changed

Added normalization and routing for manage_data Horizon operations.

packages/pulse-core/src/index.ts

  • Added DataEventType ("data.set" | "data.cleared")
  • Added DataEvent type (source, name, value: string | null, timestamp, raw)
  • Extended NormalizedEvent union to include DataEvent

packages/pulse-core/src/EventEngine.ts

  • Added manage_data branch in normalize()
  • Added normalizeManageData() — emits data.set when data_value is a non-null string, data.cleared when the field is null or absent
  • Extended route() to dispatch both data.set / data.cleared and * to the source-account watcher
  • Extended the NormalizedEventOrPending local union

packages/pulse-core/test/EventEngine.manage_data.test.ts (new file)

  • 7 unit tests covering: data.set, data.cleared (explicit null), data.cleared (field absent), wildcard emission, invalid source_account, invalid data_name, isolation from unrelated watchers

How to test

pnpm --filter @orbital/pulse-core test
# or watch mode:
pnpm --filter @orbital/pulse-core exec vitest test/EventEngine.manage_data.test.ts

Notes

  • data_value is passed through as-is (base64 string). Decoding is intentionally left to the consumer, consistent with how Horizon exposes it.
  • The routing pattern mirrors the existing account.options_changed implementation exactly.
  • No public API is removed or changed — this is purely additive.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 28, 2026

@Geff115 is attempting to deploy a commit to the determined's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 28, 2026

@Geff115 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1.18 — Normalize manage_data

1 participant