Follow-up from #1297 (not a merge blocker). Pre-existing pattern (the merge-base already called submitMessage and then cleared the input). This PR added a .catch(reportClientError) that does not match the published SDK’s promise.
Evidence
src/screens/chat.screen.tsx:411 clears inputValue and selectedFiles immediately after submitMessage(...).
Published @dfx.swiss/react 1.7.x starts file conversion in an un-awaited forEach(async ...). Conversion happens before the optimistic bubble is inserted; API failures are swallowed inside the SDK (createMessage(...).catch(() => settleMessage(messageId))). The new screen-level .catch therefore does not run on a network failure. If FileReader fails, the composer is already empty and no failed bubble appears — text and attachments are gone.
The unit test that mocks submitMessage as a rejecting promise does not model this SDK behaviour.
Suggested fix
Fix belongs in the SDK: await the send jobs, turn conversion errors into a visible failed message, and return a promise that actually rejects. In this repo, clear the composer only after the SDK has taken the optimistic message. Consume that SDK release here (same sequence as DFXswiss/packages#210).
Follow-up from #1297 (not a merge blocker). Pre-existing pattern (the merge-base already called
submitMessageand then cleared the input). This PR added a.catch(reportClientError)that does not match the published SDK’s promise.Evidence
src/screens/chat.screen.tsx:411clearsinputValueandselectedFilesimmediately aftersubmitMessage(...).Published
@dfx.swiss/react1.7.x starts file conversion in an un-awaitedforEach(async ...). Conversion happens before the optimistic bubble is inserted; API failures are swallowed inside the SDK (createMessage(...).catch(() => settleMessage(messageId))). The new screen-level.catchtherefore does not run on a network failure. IfFileReaderfails, the composer is already empty and no failed bubble appears — text and attachments are gone.The unit test that mocks
submitMessageas a rejecting promise does not model this SDK behaviour.Suggested fix
Fix belongs in the SDK: await the send jobs, turn conversion errors into a visible failed message, and return a promise that actually rejects. In this repo, clear the composer only after the SDK has taken the optimistic message. Consume that SDK release here (same sequence as DFXswiss/packages#210).