Skip to content

Fix PR #2 review follow-ups - #3

Merged
keithah merged 6 commits into
mainfrom
agent/pr-2-review-followups
Jul 22, 2026
Merged

Fix PR #2 review follow-ups#3
keithah merged 6 commits into
mainfrom
agent/pr-2-review-followups

Conversation

@keithah

@keithah keithah commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • harden camera stream preparation, failure cleanup, shutdown cleanup, and trusted-frame fetching
  • prevent repeated ready doorbell notifications and overlapping mode-command telemetry races
  • align probe temperature bounds, mode configuration input/UI constraints, and feature documentation

Why

PR #2 review feedback identified stream lifecycle leaks, a URL-validation bypass through redirects, repeated doorbell notifications, and state races between telemetry and mode commands.

Validation

  • npm test — 46 tests passed
  • npm run lint
  • npm run build
  • git diff --check

Note

Medium Risk
Changes affect live camera/ffmpeg sessions, external HomeKit accessory publishing, and oven command/token/pairing paths; regressions could impact streaming stability or device control, though coverage was expanded with unit tests.

Overview
Addresses PR #2 review feedback with hardening across camera streaming, accessory state, client security, and platform publishing.

Camera / video doorbell: Stream prep and ffmpeg lifecycle now use single-shot callbacks, shutdown clears all sessions, and failures call forceStopStreamingSession. Snapshot and live fetches use redirect: 'error'. 10011 URLs are restricted to trusted HTTPS hosts; cached stills expire after ~240s. Camera and combined doorbell+camera are published via publishExternalAccessories (with DoorbellController when both are enabled); README notes manual Home app pairing for external tiles.

Doorbell & modes: Shared watchDoorbellTriggers rings only on rising edges of ready/done. Mode switches serialize commands, ignore stale active: false while commands are in flight or preheat is pending, and the Config UI clamps mode temps (100–550°F).

Probe & config UI: Probe sensor widens HomeKit temp bounds and clears to 0°C when unplugged. Config save paths are wrapped in UI timeouts.

Client & pairing: Token refresh tolerates null/missing refresh_token; start() bails if stopped mid-boot. Pairing supersedes stuck sessions instead of blocking retries; association polling tolerates transient invalid bodies.

Docs/plan files are updated to match the shipped feature contract.

Reviewed by Cursor Bugbot for commit caa930c. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b54d2eb2-f732-45d7-bd5f-ef0523bf1688

📥 Commits

Reviewing files that changed from the base of the PR and between 81b7069 and 9390a35.

📒 Files selected for processing (6)
  • src/accessories/accessories.test.ts
  • src/accessories/mode-switch.ts
  • src/june-client-lifecycle.test.ts
  • src/june-client.ts
  • src/pairing.test.ts
  • src/pairing.ts

📝 Walkthrough

Walkthrough

The pull request adds external camera and video-doorbell support, including still-based streaming and doorbell-trigger wiring. It centralizes protocol and HTTP decoding, adds timeout and retry handling, hardens client and pairing lifecycles, serializes mode commands, and expands probe validation. The Homebridge UI pairing flow and temperature validation are updated, while documentation, build configuration, CI, and release workflows are revised.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the PR's purpose, though it is broad and references review follow-ups rather than the specific fixes.
Description check ✅ Passed The description clearly matches the implemented hardening, UI, protocol, and documentation updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/pr-2-review-followups

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

Camera/doorbell:
- Publish camera and video-doorbell accessories externally; HomeKit does
  not render a CameraController on a bridged accessory, so the feature was
  non-functional as registered.
- Use a DoorbellController (not a bare Doorbell service + CameraController)
  for the video doorbell so ring notifications carry the interior snapshot.
- Expire cached snapshots after ~240s so idle live-view taps fail fast
  instead of spawning ffmpeg against an expired pre-signed URL.
- Guard the ffmpeg exit/error/spawn handlers against a torn-down session to
  avoid a spurious forceStopStreamingSession and a leaked pump interval.

Lifecycle/telemetry:
- Tolerate a null/non-string refresh_token instead of aborting token refresh.
- Re-check stopped after startup awaits so a stop() during start() cannot
  leak the 60s status poll.
- Reset the probe temperature sensor when the probe is unplugged so stale
  hot readings don't stay latched.
- Keep a just-started mode switch on until the oven reports active (was
  flipped off by preheat/poll telemetry) and iterate a services snapshot
  when removing stale mode services.

Pairing:
- Supersede a lingering active session on begin() so pairing can be retried
  after the config UI loses the session id.
- Keep polling on a transient non-array devices body instead of failing.
- Tolerate a null refresh_token in the registration response.

Config UI:
- Preserve an entered mode temperature of 0 instead of coercing it to 350.
- Apply the request timeout to config writes, matching the read path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@keithah

keithah commented Jul 17, 2026

Copy link
Copy Markdown
Owner Author

@cursor review

@keithah
keithah requested a review from Copilot July 17, 2026 19:50
@keithah
keithah marked this pull request as ready for review July 17, 2026 19:50

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@tenki-reviewer

Copy link
Copy Markdown

Insufficient balance to process this code review. Please add funds or upgrade your plan in billing.

Comment thread src/accessories/mode-switch.ts
Comment thread src/accessories/camera.ts

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/protocol.ts (1)

124-126: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Enforce mode-temperature validation during normalization.

normalizeOvenConfig is the shared boundary for config.json, but m.tempF ?? 350 accepts non-finite or out-of-range runtime values. The UI declares a 100–550°F range, while JuneClient later passes this value directly to startMode; validate the numeric bounds here as well so hand-edited configuration cannot bypass them.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/protocol.ts` around lines 124 - 126, Update mode normalization in
normalizeOvenConfig to validate m.tempF as a finite numeric value within the
UI’s 100–550°F range before passing it to startMode. Preserve the existing 350°F
default when temperature is absent, and ensure invalid or out-of-range
configured values are normalized to a safe valid temperature.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/superpowers/plans/2026-07-08-expanded-homekit-features.md`:
- Around line 3-4: Remove the blank line within the blockquote in the historical
plan note, or prefix that line with “>”, so the entire note remains a continuous
blockquote and satisfies markdownlint MD028.

In `@docs/superpowers/specs/2026-07-08-june-expanded-homekit-features-design.md`:
- Around line 92-95: Update the “Video Doorbell integration is shipped” section
to state that enabling the camera publishes it as a separate external accessory
requiring users to add it in Home with the Homebridge PIN. Remove the claim that
the camera attaches to the same accessory without restructuring or re-pairing,
while preserving the doorbell’s standalone behavior.

In `@homebridge-ui/public/index.html`:
- Around line 352-354: Update the temperature change handler for
.field-mode-temp to reject empty raw input and values outside the inclusive
100–550 range before calling updateMode. Validate event.target.value before
numeric conversion, and preserve the 350 fallback for invalid or out-of-range
values.

In `@src/accessories/mode-switch.ts`:
- Around line 17-20: Ensure the activation latch represented by
awaitingActiveSubtype is cleared when the transition is externally cancelled or
fails to become active, rather than only on active: true or an accessory-issued
successful cancel. Update the mode-switch transition handling and JuneClient
integration as needed to propagate cancellation or apply an expiry, while
preserving suppression of premature inactive telemetry during valid activation;
add a regression test covering the latch clearing and subsequent active: false
handling.

In `@src/pairing.ts`:
- Around line 404-417: Update JunePairingSession.begin() to verify the session
remains open after each awaited asynchronous initialization operation, including
registerDevice() and requestPairingCode(), before continuing or returning
success. If destroy() or another close action occurred, stop initialization and
ensure no WebSocket is opened or success is returned for the destroyed session.

In `@src/protocol.test.ts`:
- Around line 57-58: Update the test “drops mode entries missing a
primitiveType” to include a runtime-shaped mode entry that omits the
primitiveType property, using a narrow cast if required by the type system.
Preserve the existing empty-string case only if it remains relevant, and ensure
the assertions verify entries missing the property are dropped.

---

Outside diff comments:
In `@src/protocol.ts`:
- Around line 124-126: Update mode normalization in normalizeOvenConfig to
validate m.tempF as a finite numeric value within the UI’s 100–550°F range
before passing it to startMode. Preserve the existing 350°F default when
temperature is absent, and ensure invalid or out-of-range configured values are
normalized to a safe valid temperature.
🪄 Autofix (Beta)

✅ Autofix completed


ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8290cfa8-c21d-4d64-99d1-ec5e5c3dea6f

📥 Commits

Reviewing files that changed from the base of the PR and between 0d8875a and caa930c.

📒 Files selected for processing (21)
  • README.md
  • docs/superpowers/plans/2026-07-08-doorbell-probe-polish.md
  • docs/superpowers/plans/2026-07-08-expanded-homekit-features.md
  • docs/superpowers/specs/2026-07-08-june-expanded-homekit-features-design.md
  • homebridge-ui/public/index.html
  • homebridge-ui/public/june-ui.js
  • src/accessories/camera.test.ts
  • src/accessories/camera.ts
  • src/accessories/doorbell.ts
  • src/accessories/mode-switch.ts
  • src/accessories/probe-sensor.ts
  • src/accessories/review-fixes.test.ts
  • src/june-client-lifecycle.test.ts
  • src/june-client.test.ts
  • src/june-client.ts
  • src/pairing.test.ts
  • src/pairing.ts
  • src/platform.test.ts
  • src/platform.ts
  • src/protocol.test.ts
  • src/protocol.ts

Comment thread docs/superpowers/plans/2026-07-08-expanded-homekit-features.md Outdated
Comment thread docs/superpowers/specs/2026-07-08-june-expanded-homekit-features-design.md Outdated
Comment thread homebridge-ui/public/index.html Outdated
Comment thread src/accessories/mode-switch.ts
Comment thread src/pairing.ts
Comment thread src/protocol.test.ts
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 7 file(s) based on 6 unresolved review comments.

Files modified:

  • docs/superpowers/plans/2026-07-08-expanded-homekit-features.md
  • docs/superpowers/specs/2026-07-08-june-expanded-homekit-features-design.md
  • homebridge-ui/public/index.html
  • src/accessories/accessories.test.ts
  • src/accessories/mode-switch.ts
  • src/pairing.ts
  • src/protocol.test.ts

Commit: 2f90fd2e45512b0d2264e651ea271dcea7887568

The changes have been pushed to the agent/pr-2-review-followups branch.

Time taken: 4m 45s

coderabbitai Bot and others added 3 commits July 18, 2026 15:11
Fixed 7 file(s) based on 6 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
@keithah

keithah commented Jul 22, 2026

Copy link
Copy Markdown
Owner Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.

Fix All in Cursor

Bugbot Autofix prepared fixes for all 3 issues found in the latest run.

  • ✅ Fixed: Long preheat drops mode switch
    • Removed the arbitrary activation-latch expiry so acknowledged modes remain on throughout preheat until active telemetry or cancellation clears the latch.
  • ✅ Fixed: Startup retry revives stopped client
    • Added a stopped-state check inside the queued startup retry callback before it can invoke start and revive the client.
  • ✅ Fixed: Pairing backoff exceeds session deadline
    • Reset the five-minute pairing deadline when association polling begins so user confirmation time no longer consumes the polling window.

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 81b7069. Configure here.

Comment thread src/accessories/mode-switch.ts Outdated
Comment thread src/june-client.ts
Comment thread src/pairing.ts
@keithah
keithah merged commit 65590f8 into main Jul 22, 2026
9 of 10 checks passed

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
docs/superpowers/specs/2026-07-08-june-expanded-homekit-features-design.md (1)

123-127: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Correct the documented probe-value lifecycle.

The shipped src/accessories/probe-sensor.ts resets the characteristic to 0 °C when probePresent === false; it does not retain the last value across probe-removal updates. Update this section to match the implementation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/specs/2026-07-08-june-expanded-homekit-features-design.md`
around lines 123 - 127, Update the probe-value lifecycle description in the
section referencing sensor_data.probe and probePresent to state that the
characteristic resets to 0 °C when the probe is absent, rather than retaining
the last reported value across removal updates.
src/pairing.ts (1)

351-397: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Same unguarded-post-await pattern resurfaces in waitForAssociation()'s success path.

begin() was hardened with assertOpen() after every awaited step specifically to prevent a superseded/destroyed session from mutating state or reporting success (per prior critical review feedback). waitForAssociation() gets the same treatment before/after the delay, but not after the association fetch itself: once it resolves, lines 384-390 read this.registration.deviceId/password/accessToken/refreshToken and then call setState('paired')/close() with no re-check. destroy() nulls this.registration, so if it runs while this fetch is in flight, this throws a raw TypeError instead of the intended "Pairing session was superseded." error — currently masked only because fail() no-ops when this.closed is already true. That's an incidental safety net, not an explicit guard, and it's inconsistent with the pattern this PR just established elsewhere in the same class.

🔒️ Proposed fix
       const { response, body: bodyValue } = await fetchJsonWithTimeout(`${JUNE_API_URL}/2/devices/${this.registration.deviceId}/associated`, {
         headers: { Authorization: `Bearer ${this.registration.accessToken}`, 'User-Agent': JUNE_USER_AGENT },
       });
+      this.assertOpen();
       if (!response.ok) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pairing.ts` around lines 351 - 397, Add an explicit this.assertOpen()
immediately after fetchJsonWithTimeout() returns in waitForAssociation(), before
reading this.registration or mutating status. Preserve the existing response
validation and success flow, while ensuring superseded sessions raise the
intended pairing-session error instead of accessing cleared registration state.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/superpowers/specs/2026-07-08-june-expanded-homekit-features-design.md`:
- Around line 92-94: Update the later camera integration statement near the
doorbell pairing instructions to consistently describe the camera as a
separately published external accessory, matching the contract established in
the “Video Doorbell integration is shipped” section. Remove or revise wording
that says the camera is part of the same accessory, while preserving the
standalone doorbell behavior and Home app pairing guidance.

In `@package.json`:
- Line 43: Restore a guaranteed build before publication by adding npm run build
to package.json’s prepublishOnly script. Also update
.github/workflows/release.yml at lines 31-31 so the release job runs the build
before either publish command; both sites must enforce compilation before
publishing.

In `@src/pairing.ts`:
- Line 352: Update the per-attempt delay in the association polling flow around
calculateAssociationDelay to unref the setTimeout timer using the same optional
unref pattern as the file’s other timers, while preserving the existing Promise
delay behavior.

---

Outside diff comments:
In `@docs/superpowers/specs/2026-07-08-june-expanded-homekit-features-design.md`:
- Around line 123-127: Update the probe-value lifecycle description in the
section referencing sensor_data.probe and probePresent to state that the
characteristic resets to 0 °C when the probe is absent, rather than retaining
the last reported value across removal updates.

In `@src/pairing.ts`:
- Around line 351-397: Add an explicit this.assertOpen() immediately after
fetchJsonWithTimeout() returns in waitForAssociation(), before reading
this.registration or mutating status. Preserve the existing response validation
and success flow, while ensuring superseded sessions raise the intended
pairing-session error instead of accessing cleared registration state.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 97238ed5-012b-479c-b873-cf812bdb92dc

📥 Commits

Reviewing files that changed from the base of the PR and between caa930c and 81b7069.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (30)
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • .gitignore
  • docs/superpowers/plans/2026-07-08-expanded-homekit-features.md
  • docs/superpowers/specs/2026-07-08-june-expanded-homekit-features-design.md
  • docs/superpowers/specs/2026-07-22-code-optimization-hardening-design.md
  • homebridge-ui/public/index.html
  • homebridge-ui/public/june-ui.js
  • package.json
  • src/accessories/accessories.test.ts
  • src/accessories/camera.test.ts
  • src/accessories/camera.ts
  • src/accessories/doorbell.ts
  • src/accessories/mode-switch.ts
  • src/accessories/preheat-switch.ts
  • src/accessories/probe-sensor.ts
  • src/accessories/sensors.ts
  • src/accessories/thermostat.ts
  • src/homebridge-ui.test.ts
  • src/http.test.ts
  • src/http.ts
  • src/june-client-lifecycle.test.ts
  • src/june-client.ts
  • src/pairing.test.ts
  • src/pairing.ts
  • src/platform.ts
  • src/protocol-decode.ts
  • src/protocol.test.ts
  • src/protocol.ts
  • tsconfig.json
💤 Files with no reviewable changes (1)
  • .github/workflows/ci.yml

Comment on lines +92 to +94
**Video Doorbell integration is shipped.** When both options are enabled, the Camera is published
as a separate external accessory, requiring users to add it in the Home app with the Homebridge
PIN. The doorbell operates standalone whether the camera is enabled or not.

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Keep the camera accessory contract consistent.

Lines 92–94 correctly describe a separately published camera, but Lines 115–116 still say it is implemented as part of the same accessory as the doorbell. Update the later statement so users are not given conflicting pairing instructions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/specs/2026-07-08-june-expanded-homekit-features-design.md`
around lines 92 - 94, Update the later camera integration statement near the
doorbell pairing instructions to consistently describe the camera as a
separately published external accessory, matching the contract established in
the “Video Doorbell integration is shipped” section. Remove or revise wording
that says the camera is part of the same accessory, while preserving the
standalone doorbell behavior and Home app pairing guidance.

Comment thread package.json
"test": "vitest run",
"prepack": "npm run build",
"prepublishOnly": "npm run lint && npm run test && npm run build"
"prepublishOnly": "npm run lint && npm test"

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Restore a guaranteed build before publication.

Both the package lifecycle and release workflow now omit compilation, so published artifacts may contain stale or missing dist output.

  • package.json#L43-L43: restore npm run build in prepublishOnly, or make another publish-time build authoritative.
  • .github/workflows/release.yml#L31-L31: ensure the release job runs that build before either publish command.
📍 Affects 2 files
  • package.json#L43-L43 (this comment)
  • .github/workflows/release.yml#L31-L31
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 43, Restore a guaranteed build before publication by
adding npm run build to package.json’s prepublishOnly script. Also update
.github/workflows/release.yml at lines 31-31 so the release job runs the build
before either publish command; both sites must enforce compilation before
publishing.

Comment thread src/pairing.ts
await new Promise(resolve => setTimeout(resolve, 3000));
const response = await fetchWithTimeout(`${JUNE_API_URL}/2/devices/${this.registration.deviceId}/associated`, {
this.assertOpen();
await new Promise(resolve => setTimeout(resolve, calculateAssociationDelay(attempt)));

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.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Unref the per-attempt polling delay timer.

Every other timer in this file (deadline, eviction timers) is .unref?.()'d so it doesn't keep the process alive. This delay's setTimeout isn't, so a pending association poll can hold the event loop open (up to 30s per attempt) even during shutdown.

🔒️ Proposed fix
-      await new Promise(resolve => setTimeout(resolve, calculateAssociationDelay(attempt)));
+      await new Promise<void>(resolve => {
+        const timer = setTimeout(resolve, calculateAssociationDelay(attempt));
+        timer.unref?.();
+      });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
await new Promise(resolve => setTimeout(resolve, calculateAssociationDelay(attempt)));
await new Promise<void>(resolve => {
const timer = setTimeout(resolve, calculateAssociationDelay(attempt));
timer.unref?.();
});
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pairing.ts` at line 352, Update the per-attempt delay in the association
polling flow around calculateAssociationDelay to unref the setTimeout timer
using the same optional unref pattern as the file’s other timers, while
preserving the existing Promise delay behavior.

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.

3 participants