Skip to content

PR2457 with suggested fixes - #2500

Merged
mark9064 merged 1 commit into
InfiniTimeOrg:mainfrom
DavisNT:jsfix
Nov 2, 2026
Merged

mark9064 merged 1 commit into
InfiniTimeOrg:mainfrom
DavisNT:jsfix

Conversation

@DavisNT

@DavisNT DavisNT commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

With @JoeStrout's permission (I have contacted him via e-mail and he told he probably couldn't get to this until the
week after next), here is his commit from #2457 with @NeroBurner's suggestion.

WriteResponse has no default member initialisers and both write handlers
assigned status on only one branch, so the other returned uninitialised
stack memory to the client over BLE:

- commands::WRITE assigned status only on success, so a failed FileOpen
  reported garbage. The ternary was also dead code, as res is known to be
  0 inside that branch.
- commands::WRITE_DATA assigned status only on failure, so every
  successful chunk reported garbage, which readily looks like a negative
  LittleFS error code.

Value-initialise both, matching DelResponse, MKDirResponse and
ListDirResponse in the same file, and assign status on both paths.

The visible symptom is a companion app reporting a file transfer error
against a watch that is writing the file correctly.
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Build size and comparison to main:

Section Size Difference
text 393440B 16B
data 936B 0B
bss 22920B 0B

Run in InfiniEmu

@mark9064 mark9064 added maintenance Background work bug Something isn't working labels Nov 2, 2026
@mark9064 mark9064 added this to the 1.17.0 milestone Nov 2, 2026
@mark9064
mark9064 merged commit c2b14fa into InfiniTimeOrg:main Nov 2, 2026
6 of 7 checks passed
@mark9064

mark9064 commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Please note the AI generated commit message was removed as it was against the AI policy

Also because it didn't add anything beyond the commit message :)

Thanks for picking this PR up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working maintenance Background work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants