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: return failure when PhoneAPI times out #3136

Merged
merged 4 commits into from
Jan 28, 2024

Conversation

GUVWAF
Copy link
Member

@GUVWAF GUVWAF commented Jan 27, 2024

Fixes #3132.

In notifyObservers(), we loop through all the observers. Then the PhoneAPI’s onNotifiy() got called, which then got closed in checkConnectionTimeout(). Upon closing, it removed itself from the list of observers of fromNumChanged, where we were looping through. So the iterator got invalidated and that caused a memory corruption and a hardfault on the RP2040.
Now the PhoneAPI returns a failure when this happens, such that the loop through the observers exits.

Also renamed observed to observables because it's a list of Observable.
Also added debug configurations for the RP2040.

GUVWAF and others added 4 commits January 27, 2024 08:40
In `onNotify()`, when disconnected, PhoneAPI removed itself from the list of observers that was looped through in `notifyObservers()`. We should exit that loop in that case.
thebentern added a commit to meshtastic/artifacts that referenced this pull request Jan 27, 2024
@thebentern thebentern merged commit 417feee into meshtastic:master Jan 28, 2024
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants