Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(app): Fix accidental polling when a query is initially disabled #17853

Merged
merged 1 commit into from
Mar 21, 2025

Conversation

SyntaxColoring
Copy link
Contributor

@SyntaxColoring SyntaxColoring commented Mar 21, 2025

Overview

While testing EXEC-1342, we noticed a bug in our notifications machinery that would cause the app to poll even when MQTT was available and it shouldn't have to.

Details

Specifically, the bug would happen for queries that started off with options of {enabled: false} and became {enabled: true} later on. Here is the motivating example.

The useNotifyDataReady hook had a piece of state, isNotifyEnabled, that would accidentally permanently latch to false whenever the hook saw {enabled: false}.

Test Plan and Hands on Testing

Tested as part of #17832 by monitoring the network logs.

Review requests

Makes sense? Names good?

Risk assessment

Medium. This is common code for a lot of stuff, and it's hard to test.

Copy link
Contributor

@mjhuff mjhuff left a comment

Choose a reason for hiding this comment

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

Noice. Glad this hasn't bit us anywhere in prod :)

@SyntaxColoring SyntaxColoring marked this pull request as ready for review March 21, 2025 20:20
@SyntaxColoring SyntaxColoring requested a review from a team as a code owner March 21, 2025 20:20
@SyntaxColoring SyntaxColoring requested review from shlokamin and removed request for a team March 21, 2025 20:20
@SyntaxColoring SyntaxColoring merged commit bb82e49 into edge Mar 21, 2025
36 checks passed
@SyntaxColoring SyntaxColoring deleted the fix_notifications_enabled_later branch March 21, 2025 20:23
SyntaxColoring added a commit that referenced this pull request Mar 21, 2025
…17832)

## Overview

The client-side half of EXEC-1342.

## Test Plan and Hands on Testing

* [x] I guess at this point we can turn on the feature flag and try this
out by entering LPC on one client and changing offsets on another?
  * Tested with a merge of this PR, #17853, #17817, and #17850.

## Changelog

The client was polling `POST /labwareOffsets/searches`. This switches it
to only happen when the client receives a notification from the server
that offsets have changed, with a polling fallback. I'm entirely
cargo-culting the patterns from the existing `useNotify___()` hooks.

## Risk assessment

Medium. I don't think we have a good way to integration-test this kind
of thing, so there are risks of things like missed updates, or
inadvertent polling.
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