Skip to content

Fix inject bug#64

Merged
steven-tey merged 2 commits intomainfrom
fix-inject
Sep 30, 2025
Merged

Fix inject bug#64
steven-tey merged 2 commits intomainfrom
fix-inject

Conversation

@steven-tey
Copy link
Contributor

@steven-tey steven-tey commented Sep 29, 2025

Summary by CodeRabbit

  • Refactor

    • Streamlined analytics event queuing to use a consistent queued entry format, improving stability and consistency of event processing, especially during initialization and early page interactions.
  • Chores

    • Bumped @dub/analytics-script to 0.0.31.
    • Bumped web package to 0.0.31.

@vercel
Copy link

vercel bot commented Sep 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
analytics-nextjs-geolocation-script Ready Ready Preview Comment Sep 30, 2025 5:13am

@coderabbitai
Copy link

coderabbitai bot commented Sep 29, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Version bumps in two packages to 0.0.31 and an internal change to analytics method queuing in the web package: method calls are now enqueued as tuples [method, ...args] into w[da].q instead of invoking the handler immediately.

Changes

Cohort / File(s) Summary
Version bumps
packages/script/package.json, packages/web/package.json
Increment versions from 0.0.30 to 0.0.31; no other fields changed.
Analytics queue logic
packages/web/src/generic.ts
Change per-method handling: push [method, ...args] into w[da].q instead of calling w[da](method, ...args) immediately; no exported API changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User Code
  participant W as window
  participant DA as w[da] (stub)
  participant Q as Queue (w[da].q)
  participant P as Real Analytics (loaded later)

  rect rgba(220,235,245,0.4)
    note over U,W: Page load (stub present)
    U->>DA: call method m(...args)
    DA->>Q: push [m, ...args]
    note right of Q: Tuple enqueued
  end

  rect rgba(235,245,220,0.4)
    note over P: Library initializes
    P->>Q: drain queue
    loop For each item
      Q-->>P: [m, ...args]
      P->>P: dispatch m(...args)
    end
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

A hop, a bump, a tidy queue,
I stash the method, args in view.
When scripts arrive, we run the show—
From tuples sprung, the events will flow.
Version nibble, 0.0.31, whee!
A rabbit’s log: queued joy and glee. 🐇✨

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-inject

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5628ca8 and 1c39fa8.

📒 Files selected for processing (3)
  • packages/script/package.json (1 hunks)
  • packages/web/package.json (1 hunks)
  • packages/web/src/generic.ts (1 hunks)

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
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

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

@steven-tey steven-tey requested a review from devkiran September 30, 2025 05:13
@steven-tey steven-tey merged commit 077192e into main Sep 30, 2025
3 of 4 checks passed
@steven-tey steven-tey deleted the fix-inject branch September 30, 2025 05:13
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.

2 participants