Skip to content

Prevent stale analytics renders and unhandled API rejections - #2

Merged
n30nex merged 3 commits into
masterfrom
codex/dev-analytics-readiness
Oct 15, 2026
Merged

n30nex merged 3 commits into
masterfrom
codex/dev-analytics-readiness

Conversation

@n30nex

@n30nex n30nex commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Analytics could render before its data arrived or let a delayed response replace a newer filter, tab, or page visit. Both the core load and independently loaded tabs now check that their view is still current before changing content, state, or scheduled work. Current errors remain visible and a refresh can recover.

The shared API helper also stops creating an unhandled rejection when its caller already handles a failed request. Request sharing, caching, and warmup retries retain their existing behavior.

Addresses Kpa-clawbot#2200 and Kpa-clawbot#2212, including the lazy-tab race reported in this PR's review. This fork PR is based on codex/canadaverse-ui and preserves the existing PostgreSQL and Canadaverse changes.

Validation

  • 41 analytics lifecycle checks cover core and lazy tabs, old successes/failures, filter changes, navigation away/re-entry, detail selections, overlapping refreshes, and obsolete timers/animation callbacks.

  • Seven API cleanup checks cover concurrent callers, cache TTL/bust, HTTP/network/JSON failures, exhausted warmup retries, recovery, and absence of extra unhandled rejections.

  • All standalone frontend suites passed locally. The server and ingestor Go suites passed locally.

  • Eight browser scenarios passed against an isolated local Go/SQLite instance, including delayed lazy responses, HTTP 500 handling, and successful retry. The existing neighbour-graph filter/theme regression also passed.

The lifecycle check is O(1) per async completion or callback. Weak DOM keys allow replaced views to be collected. The change adds no API requests, dependencies, configuration settings, or database changes.

Deployment

Commit d961022cbe0419d8cb6c3af918673e3948b6ca3f was deployed and verified on Canadaverse CoreScope. Its changes remain included in the current deployment through follow-up PR #3. The complete CI run passed both database backends, all browser shards, race checks, and packaged image/startup checks. This stacked PR uses an explicit workflow dispatch because automatic PR runs target master.

The public API reports the exact commit, and both JavaScript files delivered to the browser match the committed SHA-256 hashes. Live browser checks covered rapid YKF/YYZ filter changes and switching between Nodes and Neighbour Graph, with no JavaScript errors during those interactions.

The application completed startup and is healthy on PostgreSQL. Both Canadian MQTT sources are fresh, database write errors are zero, and the existing account remains present. Configuration and theme files, the 96 MB packet-store limit, and the 24-hour retention policy were preserved. No other container changed. The previous application image and a private configuration snapshot remain available for rollback.

The regional role-count mismatch recorded in Kpa-clawbot#2213 is addressed and live-verified in follow-up PR #3.

@n30nex
n30nex marked this pull request as ready for review October 13, 2026 08:07
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T08:10:48.276455Z c639e79 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c639e794bb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread public/analytics.js
@n30nex n30nex changed the title Keep analytics loading and filter changes consistent Prevent stale analytics renders and unhandled API rejections Oct 14, 2026
@n30nex

n30nex commented Oct 14, 2026

Copy link
Copy Markdown
Owner Author

Review feedback addressed (commit d961022)

  1. Independently loaded analytics tabs now reject obsolete successes and failures after filter changes, tab switches, or navigation away/re-entry, including the Nodes race identified in review.
  2. The same lifecycle checks cover nested RF/subpath requests, overlapping Roles/Scopes refreshes, distance retries, and delayed graph/layout callbacks. The neighbour graph continues to preserve its filters and canvas on theme refresh.
  3. Separate commit 2e9f302 fixes the shared API helper's extra unhandled rejection during failed-request cleanup (Frontend API helper emits an unhandled rejection for already handled failures Kpa-clawbot/CoreScope#2212), while preserving request sharing, cache TTL/bust, and warmup retry behavior.
  4. Parent review and local validation passed: all standalone frontend suites, both Go suites, 41 analytics lifecycle checks, seven API cleanup checks, eight browser scenarios, and the existing neighbour-graph regression. The complete CI run for d961022cbe0419d8cb6c3af918673e3948b6ca3f also passed both database backends, all browser shards, concurrency checks, and packaged images.

@n30nex
n30nex changed the base branch from codex/canadaverse-ui to master October 15, 2026 19:46
@n30nex
n30nex merged commit 561d014 into master Oct 15, 2026
20 checks passed
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