Skip to content

Sync protos to BSR 8b5d068 and expose the new reads - #17

Merged
poluruprvn merged 4 commits into
mainfrom
chore/sync-protos
Oct 10, 2026
Merged

poluruprvn merged 4 commits into
mainfrom
chore/sync-protos

Conversation

@poluruprvn

@poluruprvn poluruprvn commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Bumps PROTO_COMMIT to 8b5d068, which matches pug main (b9d5434) on every vendored path, and regenerates src/gen. The well-known event registry is unchanged.

SDK changes

  • New read: pug.activity.profileSessions(req) wraps the new GetProfileSessions RPC.
  • Bot filtering: the server now leaves bot-tagged traffic out of reads by default.
    • profiles.get and getByExternalId take { includeBots } as a second argument.
    • Every other read already passes includeBots through in its request.
  • Reserved prefix: the server now rejects a whole batch if any event's distinct_id starts with cookieless-, so track() drops such an event before it can sink the others. identify() already refuses such an externalId through the regenerated validation.
  • Server drops: BatchCreate now reports refused events in dropped and droppedByReason instead of failing the request. The SDK logs a warning with the reasons, since otherwise the loss is silent.

Notes

Testing

  • make ci passes: codegen is in sync, lint is clean, and the build succeeds.
  • 58 tests pass, 4 of them new.

Summary by CodeRabbit

  • New Features
    • Added profile session history, with pagination, sorting, time-range filtering, and optional bot inclusion.
    • Added map-based insights and average events per session metrics.
    • Added options to include bot-tagged traffic in activity and profile reads; bot traffic is excluded by default.
    • Added support for cookieless events and reporting dropped events with drop reasons.
  • Bug Fixes
    • Events with reserved cookieless IDs are now dropped, and external IDs using that prefix are rejected.
    • Event batches now log warnings when events are dropped.

Picks up pug main as of b9d5434: cookieless events and the reserved 'cookieless-' id prefix, dropped counts on BatchCreateResponse, GetProfileSessions, include_bots on reads, and map insights. src/gen is regenerated; the well-known event registry is unchanged.
BatchCreate now reports refused events in dropped and dropped_by_reason instead of failing the request, so without a log the loss is silent.
activity.profileSessions wraps the new GetProfileSessions RPC, and profiles.get and getByExternalId take an includeBots option; the other reads already pass it through in their request.

track() drops a distinctId that starts with 'cookieless-', since the server rejects the whole batch over one and takes other users' events with it. identify() already refuses such an externalId through the regenerated validation.
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9ca9f8b0-2ebd-4db2-91ef-6e69d5cc13a3

📥 Commits

Reviewing files that changed from the base of the PR and between 4c13afe and 27bd034.


⛔ Files ignored due to path filters (6)
  • src/gen/common/events/v1/navigation_events_pb.ts is excluded by !**/gen/**
  • src/gen/sdk/events/v1/events_pb.ts is excluded by !**/gen/**
  • src/gen/sdk/profiles/v1/profiles_pb.ts is excluded by !**/gen/**
  • src/gen/shared/activity/v1/activity_pb.ts is excluded by !**/gen/**
  • src/gen/shared/insights/v1/insights_pb.ts is excluded by !**/gen/**
  • src/gen/shared/profiles/v1/profiles_pb.ts is excluded by !**/gen/**

📒 Files selected for processing (12)
  • Makefile
  • README.md
  • proto/common/events/v1/navigation_events.proto
  • proto/sdk/events/v1/events.proto
  • proto/sdk/profiles/v1/profiles.proto
  • proto/shared/activity/v1/activity.proto
  • proto/shared/insights/v1/insights.proto
  • proto/shared/profiles/v1/profiles.proto
  • src/pug.test.ts
  • src/pug.ts
  • src/transport.test.ts
  • src/transport.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.



📝 Walkthrough

Walkthrough

The change updates protobuf contracts for cookieless event ingestion, bot-aware activity and profile reads, profile sessions, and insight queries. The Node SDK adds matching read methods and identity checks, and its batch transport reports dropped events. README and protobuf comments document related request options and event properties.

Changes

Event identity and batch reporting

Layer / File(s) Summary
Event and identity contracts
Makefile, proto/common/events/v1/navigation_events.proto, proto/sdk/events/v1/events.proto, proto/sdk/profiles/v1/profiles.proto
Event contracts add cookieless validation, reject reserved identity prefixes, and add dropped-event counts and reasons to batch responses. The pinned proto revision and navigation event property documentation also change.
SDK identity checks and batch warnings
src/pug.ts, src/pug.test.ts, src/transport.ts, src/transport.test.ts
track() drops reserved-prefix distinct IDs, and batch transport warns when a response reports dropped events. Tests cover these behaviors and reserved-prefix external IDs.

Bot-aware reads and profile sessions

Layer / File(s) Summary
Activity bot filters and profile sessions
proto/shared/activity/v1/activity.proto
Activity requests add bot-inclusion fields. The service adds paginated profile-session requests and responses with sort, time-range, and bot options.
Profile filters and SDK read methods
proto/shared/profiles/v1/profiles.proto, src/pug.ts, src/pug.test.ts, README.md
Profile requests add bot-inclusion fields, and activity summaries add a bot flag. The SDK forwards profile read options and profile-session requests. Tests and README document the SDK methods and options.

Insight query contracts

Layer / File(s) Summary
Map insight query contract
proto/shared/insights/v1/insights.proto
Insight query fields add map configuration and bot and cookieless options. Validation constrains map configuration, and the schema adds the map insight type and MapQuery.
Session metrics and user-flow fields
proto/shared/insights/v1/insights.proto
The schema adds an average-events-per-session metric, clarifies user-flow limits and overflow nodes, and adds depth and label to UserFlowNode.

Priority: ➖ Normal

Change: Feature

Merge Risk: ⚪ Minimal · up to 27bd0

No confirmed issue remains that would prevent merging after normal checks.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main changes: syncing protos to commit 8b5d068 and exposing new read APIs.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 4…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR


🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 Buf (1.73.0)
proto/common/events/v1/navigation_events.proto

fatal: unable to access 'https://github.com/pug-sh/sdk-node.git/': Failed to connect to github.com:443 over proxy 127.0.0.1 after 0 ms: Could not connect to server
fatal: could not fetch 7cceb2ab48a3c79daa0357f7db92c8ebbc92114e from promisor remote

CODERABBIT_BUF_COMPATIBILITY_PHASE=materialize-base


proto/sdk/events/v1/events.proto

fatal: unable to access 'https://github.com/pug-sh/sdk-node.git/': Failed to connect to github.com:443 over proxy 127.0.0.1 after 0 ms: Could not connect to server
fatal: could not fetch 7cceb2ab48a3c79daa0357f7db92c8ebbc92114e from promisor remote

CODERABBIT_BUF_COMPATIBILITY_PHASE=materialize-base


proto/sdk/profiles/v1/profiles.proto

fatal: unable to access 'https://github.com/pug-sh/sdk-node.git/': Failed to connect to github.com:443 over proxy 127.0.0.1 after 0 ms: Could not connect to server
fatal: could not fetch 7cceb2ab48a3c79daa0357f7db92c8ebbc92114e from promisor remote

CODERABBIT_BUF_COMPATIBILITY_PHASE=materialize-base


  • 3 others


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@poluruprvn

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@poluruprvn
poluruprvn merged commit 8ef386d into main Oct 10, 2026
5 checks passed
@poluruprvn
poluruprvn deleted the chore/sync-protos branch October 10, 2026 06:42
poluruprvn added a commit that referenced this pull request Oct 10, 2026
Ship the protovalidate 1.3 fixes from #16 and the proto sync from #17. 0.0.6's
`^1.1.1` range already resolves to protovalidate 1.3, which silently drops
wrong-typed well-known props and sends non-object identify() traits as `{}`.

A wrong-typed well-known prop now drops the whole event with a log naming the
field, and track() drops a distinctId with the reserved `cookieless-` prefix.
#17 also adds `activity.profileSessions`, `includeBots` on reads, and map
insights.
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 participant