Skip to content

Remove gradient sync nonce and simplify replay handling#10459

Merged
thebentern merged 6 commits into
developfrom
remove-gradient-sync-nonce
May 12, 2026
Merged

Remove gradient sync nonce and simplify replay handling#10459
thebentern merged 6 commits into
developfrom
remove-gradient-sync-nonce

Conversation

@thebentern
Copy link
Copy Markdown
Contributor

@thebentern thebentern commented May 12, 2026

I'm willing to admit, the gradient sync was a good idea, but it was a mistake to add new nonces. We should just always split the telem and position sync post complete node sync. Tested and it's working great on iOS. I'll do some Android testing too.

@thebentern thebentern requested a review from Copilot May 12, 2026 00:07
@github-actions github-actions Bot added needs-review Needs human review enhancement New feature or request labels May 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the “gradient sync” opt-in nonces and simplifies PhoneAPI’s initial sync by (a) always sending thin NodeInfo headers for peers and (b) draining cached satellite-DB data (positions/telemetry/environment/status) after config_complete_id, interleaved with live traffic in STATE_SEND_PACKETS.

Changes:

  • Removed gradient-sync nonce definitions and the clientWantsGradientSync() gate.
  • Replaced the four replay states with a ReplayPhase mini-state-machine that drains in STATE_SEND_PACKETS.
  • Updated Copilot instructions to describe the new default sync/replay flow.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
src/mesh/PhoneAPI.h Removes gradient nonce constants and introduces ReplayPhase helpers for post-sync replay.
src/mesh/PhoneAPI.cpp Moves satellite replay to trail config_complete_id and interleave with live traffic; adjusts replay packet shaping (broadcast-like).
.github/copilot-instructions.md Documents the new default sync flow (thin NodeInfos + post-complete replay drain).

Comment thread src/mesh/PhoneAPI.cpp Outdated
Comment thread src/mesh/PhoneAPI.h Outdated
Comment thread src/mesh/PhoneAPI.cpp Outdated
Comment thread src/mesh/PhoneAPI.cpp Outdated
Comment thread .github/copilot-instructions.md
@thebentern
Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

@copilot apply changes based on the comments in this thread

Applied the requested review-thread fixes in 2a8e030: SPECIAL_NONCE_ONLY_CONFIG now skips post-complete replay, stale gradient-sync wording was removed from PhoneAPI comments, and the sync-flow docs were reworded to describe default flow plus explicit nonce exceptions.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.registry.nm1.platformio.org
    • Triggering command: /home/REDACTED/.local/bin/pio /home/REDACTED/.local/bin/pio test -e native -f test_default (dns block)
    • Triggering command: /home/REDACTED/.local/bin/pio /home/REDACTED/.local/bin/pio test -e native -f test_default -v (dns block)
    • Triggering command: /home/REDACTED/.local/bin/pio /home/REDACTED/.local/bin/pio test -e native -f test_default --json-output gsign/gh-gpgsign-linux-x86_64 (dns block)
  • api.registry.platformio.org
    • Triggering command: /home/REDACTED/.local/bin/pio /home/REDACTED/.local/bin/pio test -e native -f test_default (dns block)
    • Triggering command: /home/REDACTED/.local/bin/pio /home/REDACTED/.local/bin/pio test -e native -f test_default -v (dns block)
    • Triggering command: /home/REDACTED/.local/bin/pio /home/REDACTED/.local/bin/pio test -e native -f test_default --json-output gsign/gh-gpgsign-linux-x86_64 (dns block)
  • collector.platformio.org
    • Triggering command: /home/REDACTED/.local/bin/pio /home/REDACTED/.local/bin/pio test -e native -f test_default (dns block)
    • Triggering command: /home/REDACTED/.local/bin/pio /home/REDACTED/.local/bin/pio test -e native -f test_default -v (dns block)
    • Triggering command: /home/REDACTED/.local/bin/pio /home/REDACTED/.local/bin/pio test -e native -f test_default --json-output gsign/gh-gpgsign-linux-x86_64 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.

Comment on lines 66 to +74
meshtastic_PositionLite TypeConversions::ConvertToPositionLite(meshtastic_Position position)
{
meshtastic_PositionLite lite = meshtastic_PositionLite_init_default;
lite.latitude_i = position.latitude_i;
lite.longitude_i = position.longitude_i;
lite.altitude = position.altitude;
lite.location_source = position.location_source;
lite.time = position.time;
lite.precision_bits = position.precision_bits;
Comment thread src/mesh/PhoneAPI.cpp Outdated
@thebentern
Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

@copilot apply changes based on the comments in this thread

Applied the review-thread follow-ups in a231370: ConvertToNodeInfo(..., position, ...) now copies position->precision_bits into bundled NodeInfo.position, and the temporary per-node LOG_INFO sync logging was removed from PhoneAPI.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.registry.nm1.platformio.org
    • Triggering command: /home/REDACTED/.local/bin/pio /home/REDACTED/.local/bin/pio test -e native -f test_type_conversions (dns block)
  • api.registry.platformio.org
    • Triggering command: /home/REDACTED/.local/bin/pio /home/REDACTED/.local/bin/pio test -e native -f test_type_conversions (dns block)
  • collector.platformio.org
    • Triggering command: /home/REDACTED/.local/bin/pio /home/REDACTED/.local/bin/pio test -e native -f test_type_conversions (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@thebentern thebentern merged commit f7548e7 into develop May 12, 2026
68 checks passed
@thebentern thebentern deleted the remove-gradient-sync-nonce branch May 12, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request needs-review Needs human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants