fix: Re-initiate subscription telemetry on _reset() to prevent data loss - #6
fix: Re-initiate subscription telemetry on _reset() to prevent data loss#6samanthataylor3 wants to merge 1 commit into
Conversation
When user manually changes time conductor bounds, TelemetryCollection._reset() clears all data and re-requests historical data, but did not re-initiate the subscription. Some subscription providers supply 'latest available data' on initial subscription. Since the subscription was never reset during _reset(), that initial LAD data from the provider was lost. This adds a call to _initiateSubscriptionTelemetry() in _reset(), mirroring what load() already does. The method already safely unsubscribes before re-subscribing, so this is safe. Closes #4 Co-Authored-By: Samantha Taylor <samantha.taylor@cognition.ai>
Original prompt from Samantha
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Closes #4
Describe your changes:
When a user manually changes time conductor bounds,
TelemetryCollection._reset()clears all data and re-requests historical data, but did not re-initiate the subscription. Some subscription providers supply "latest available data" (LAD) on initial subscription. Since the subscription was never reset during_reset(), that initial LAD data from the provider was lost.Fix: Add
this._initiateSubscriptionTelemetry()in_reset(), mirroring whatload()already does at lines 170–171. The_initiateSubscriptionTelemetry()method already safely unsubscribes before re-subscribing, so this is safe._reset() { this.boundedTelemetry = []; this.futureBuffer = []; this.emit('clear'); this._requestHistoricalTelemetry(); + this._initiateSubscriptionTelemetry(); }All call sites that trigger
_reset()benefit from this fix:_bounds()— on mode change_handleUserBoundsChange()— on user-initiated bounds change_setTimeSystemAndFetchData()— on time system changeAlso removed the stale
@todo handle subscriptions more granularlycomment since this is now handled.All Submissions:
Author Checklist
type:label? Note: this is not necessarily the same as the original issue.Reviewer Checklist
Link to Devin session: https://app.devin.ai/sessions/b42c44263e2f4e49b934c88a2c5e4adb
Requested by: @samanthataylor3
Devin Review