openvibers/openvibe.sdk Commits
Surface opaque event cursors in the SDK events clients (after / next_cursor; afterSeq kept one release); release 0.33.0 (#17)
OP OpenVibers committed 5 Oct 2026 · tag v0.33. · 0 files, +0 −0
* Surface opaque event cursors in the SDK events clients (after / next_cursor; afterSeq kept one release); release 0.33.0
**Changes (file:line)**
- `src/events.js:189` — `pull()` takes `after` (opaque cursor) and sends `after=<cursor>` when given, else falls back to `after_seq`; page doc updated.
- `src/events.js:210` — `iterate()` accepts `after`, starts from `after`/`afterSeq`, advances on `page.next_cursor ?? page.next_after_seq` (numeric compat field still drives the catch-up check); empty pages still call `onPage`.
- `types/events.d.ts:6` — `StoredEvent` gains `cursor: string`.
- `types/events.d.ts:8` — `EventsPage` gains `next_cursor: string`.
- `types/events.d.ts:26,28` — `EventsClient.pull`/`iterate` accept `after?: string`; comment now says save `page.next_cursor`.
- `types/events.d.ts:68,69` — `AppEventsClient.pull`/`iterate` likewise.
- `src/testing/index.js:361` — mock platform models opaque cursors `c1.<epoch>.<base64url(seq)>` (encode/decode).
- `src/testing/index.js:460,482` — mock `GET /api/v1/events` accepts `after`, returns per-event `cursor` and page `next_cursor`.
- `src/testing/index.js:489` — mock `GET /api/v1/events/:id` returns `cursor`.
- `test/events.test.js:74-95` — opaque cursor round-trip (pull `after`, iterate `after`), `afterSeq` still works, `get()` carries the cursor.
- `test/events.test.js:99-113` — new test: `onPage` advances the cursor on a page that matches no events, and resuming replays nothing.
- `test/app-events.test.js:133-137` — app-scoped pull cursor round-trip + `afterSeq` fallback.
- `test/app-events.test.js:149-152` — app `iterate` `onPage` yields a `next_cursor`.
- `README.md:217` — pagination note names the opaque `after`/`next_cursor`.
- `package.json:3`, `src/core/index.js:11`, `package-lock.json:3,9`, `STATUS.json:6`, `README.md:5,12` — 0.32.0 → 0.33.0.
- `CHANGELOG.md:10` — new `## 0.33.0 (2026-10-05)` entry.
- `browser/openvibe-sdk.mjs:1,45` — regenerated (`node scripts/browser-bundle.js`). `node scripts/esm.js` produced no diff (no export changes, so `esm/events.mjs` is unchanged).
**Where the real shape differed from the brief**
- `README.md:115` in the task points at **OpenVibe.Events'** README (it documents `after=<next_cursor>` and the `{ events: [{seq, cursor, event}], next_cursor, … }` page); this repo's `README.md:115` is about sandbox/production and its pagination note is at `:217` as stated. I used `~/OpenVibers/OpenVibe.Events` `server/api/read.js` and `server/cursor.js` to confirm the wire contract.
- The page type carries **two** additions, not one: a per-event `cursor` on `StoredEvent` and `next_cursor` on `EventsPage` (the task's `types/events.d.ts:8` covered only the page).
- `src/testing/index.js` was not in the task list but had to change: the mock platform returned no cursors and didn't accept `after`, so `test/app-events.test.js` (which runs entirely against the mock) couldn't assert a round-trip. `src/events.js:185` pull / `:201-212` iterate line numbers matched `origin/main`.
**Tests**: `ov test events app-events` → **2 passed in 2 s** (`test/events.test.js`, `test/app-events.test.js`). Version metadata verified consistent (pkg/core/lock/STATUS/bundle/CHANGELOG all 0.33.0). Not committed or pushed.
* iterate() keeps paging on a cursor-only server and keeps a string afterSeq numeric (review)
This commit has no diff to show.