Skip to content

No connection attempts after the paired device's mDNS entry expired#74

Open
randomdudebunchofnumbers wants to merge 6 commits intoenbility:devfrom
randomdudebunchofnumbers:bug/attempt_reconnect_when_device_reappears
Open

No connection attempts after the paired device's mDNS entry expired#74
randomdudebunchofnumbers wants to merge 6 commits intoenbility:devfrom
randomdudebunchofnumbers:bug/attempt_reconnect_when_device_reappears

Conversation

@randomdudebunchofnumbers
Copy link
Copy Markdown

Hello,

this pull request tries to solve issue #73. I'd like to ask you to have a look and tell me what you think. Thank you very much.

@coveralls
Copy link
Copy Markdown

coveralls commented Apr 15, 2026

Coverage Status

coverage: 94.82% (+0.1%) from 94.71% — randomdudebunchofnumbers:bug/attempt_reconnect_when_device_reappears into enbility:dev

@uhl uhl self-requested a review April 15, 2026 08:06
Martin.Beims added 3 commits April 16, 2026 07:44
…ewer attempt

Add a per-SKI generation counter so prepareConnectionInitation's defer
only resets the flag when the callback belongs to the current attempt,
preventing a stale callback from cancelling a legitimate reconnection.
@randomdudebunchofnumbers
Copy link
Copy Markdown
Author

To be fair, the analysis of the current implementation revealed some issues with stale timers and memory leaks. Nothing critical, but worth checking. I've now updated my pull request with some fixes and tests and would really appreciate it if you could have a look. Thank you.

@DerAndereAndi DerAndereAndi added the bug Something isn't working label Apr 17, 2026
@sthelen-enqs
Copy link
Copy Markdown
Contributor

We actually discovered and looked into this issue independently early last week, I'm not sure the connectionAttemptGeneration is necessary.
We created a branch that should fix the same issue. We bypass the race condition you mention in your PR by only resetting isConnectionAttemptRunning state if we manage to cancel the Timer before it fires.
Could you evaluate if this bypasses the necessity for the added generations?
I'd like to avoid added complexity if possible, but don't mind either solution as long as they fix the issue (well).

sthelen-enqs added a commit that referenced this pull request Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants