Skip to content

Subscribe BMS cell topics only while a page shows them - #1013

Open
bracyw wants to merge 15 commits into
996-sidebar-rendered-row-valuesfrom
995-release-bms-cell-topics
Open

bracyw wants to merge 15 commits into
996-sidebar-rendered-row-valuesfrom
995-release-bms-cell-topics

Conversation

@bracyw

@bracyw bracyw commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Changes

Stacked on #1012. CellService no longer subscribes to the ~720 BMS cell topics app-wide at startup. Components that show cell data call updateCellInfo, which now returns a release: the segment heatmap while it exists, and the Cell Comparison panel while it's open (it's an overlay that can outlive the BMS pages). On the last release, readings are cleared so nothing shows stale values.

Diagram

flowchart LR
  HM["Segment heatmap<br/>while it exists"] -- "updateCellInfo() → release" --> CS
  CC["Cell Comparison panel<br/>while open"] -- "updateCellInfo() → release" --> CS
  CS["CellService<br/>counts holders"]
  CS -- "first hold: storage.get<br/>~720 BMS cell topics" --> ST["Storage"]
  CS -. "last release: unsubscribe,<br/>clear readings" .-> ST
Loading

Testing

  • New CellService spec (7 tests) plus heatmap and cell-view spec additions
  • Live against Calypso with Deliver each topic through its own Socket.IO room #1010's server (demos in angular-client/demos/v1/scripts; the overlay counts the data msgs/s and topics this browser receives, and the last list it sent)

Demo

Switching pages: 0:00 Charging (23 topics) · 0:05 Open BMS (its topics added at once in one list, then Charging's dropped at the next sweep: 751 topics, ~700 msgs/s) · 0:13 Back to Charging (its topics added at once; BMS's stop at the next sweep, within 2.5 s)

selective-delivery.mp4

Reconnect: 0:00 BMS live · 0:05 Connection drops · 0:10 Reconnected (the handshake carries the page's 751 topics, no reload)

reconnect.mp4

Notes

  • The segment page wasn't checked live; its heatmap uses the same code.
  • The header's Msgs/Sec is everything the server receives (~4,000); the overlay is what this browser gets.

Checklist

  • Commits are tagged with the ticket number
  • Lint, format and tests pass
  • No merge conflicts
  • All checks passing
  • Screenshots of UI changes (see Demo)
  • No package-lock.json changes unless dependencies changed
  • Request reviewers & ping on Slack

Closes #995

…hows them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013vbA3j9hMDhLiYyTkHLpH8
Co-Authored-By: bracyw <138251570+bracyw@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 411919e1-0afd-4f4d-b2d3-f776e5841f0b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

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

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

@bracyw bracyw added frontend Development Focused in the Frontend by: ai Written by AI dev work Implementation work: feature, bug, or task labels Nov 20, 2026 — with Claude
@bracyw
bracyw added this pull request to stack #1014 November 20, 2026 20:43
@bracyw
bracyw removed this pull request from stack #1014 November 20, 2026 21:10
@bracyw
bracyw changed the base branch from 994-client-topic-subscriptions to 996-sidebar-rendered-row-values November 20, 2026 21:10
@bracyw
bracyw added this pull request to stack #1015 November 20, 2026 21:10
@bracyw
bracyw marked this pull request as ready for review November 20, 2026 21:14

@TheJeffreyKuo TheJeffreyKuo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, a problem caught and a question

this.subscribeToBetaCellInfo();
}
let released = false;
return () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Keep cell readings across BMS page switches, as before; delay this teardown by TOPIC_SWEEP_MS

* each topic's latest value, so a quick page switch keeps the readings); the last release drops
* them and clears the readings, which would otherwise go stale.
*/
updateCellInfo = (): (() => void) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should the segment page subscribe only its own segment's cells?

This branch has not been deployed

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

Labels

by: ai Written by AI dev work Implementation work: feature, bug, or task frontend Development Focused in the Frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Release BMS cell topics when no page shows them

3 participants