By Xav

← Writing

What happens after Cancel?

Open a support chat, tap Attach, then close the file picker. Maybe you picked the wrong conversation. Maybe you just want to check the photo first. A moment later, you tap Attach again.

That second tap was where an Ada chat integration I worked on in Flutter could go wrong. A person who picked a file straight away could carry on. A person who dismissed the picker could come back to a button that no longer worked.

Follow the return trip

The chat asks for a file and the phone opens its picker. Choosing a photo sends something back that I can see in the conversation. Cancelling is quieter. The picker disappears, and the chat looks much the same as it did before.

To narrow down that kind of bug, I follow the second attempt. Does tapping the button make another request? Does the phone open the picker? If I choose a file this time, does it appear once in the chat? Each answer narrows the stretch of code I need to read.

An empty result can still finish a request

The distinction I care about at an SDK boundary is between “still waiting” and “finished without a file.” They look identical if all I inspect is the attachment list. They behave very differently when I tap again.

Before changing the integration, I’d trace where the second request stops. If the chat emits it and the native picker never opens, I’d inspect the bridge’s pending-request state. If the picker opens and returns a file, I’d follow delivery back into the chat. Those are two hypotheses with different evidence. Seeing an unresponsive button alone doesn’t establish either one.

For the regression check I’d keep the same chat open throughout. Dismiss the picker, reopen it, select a file, then check the conversation for exactly one attachment. Recreating the chat between attempts could clear the very state the test is meant to exercise.

All posts →