fix(web): retry-after-abort starts fresh tus session; preserve File past abort
This commit is contained in:
@@ -522,13 +522,16 @@ export function Message({ message, isCompact, isFirstInGroup, previousMessageId
|
||||
<button
|
||||
onClick={async () => {
|
||||
const transfers = useTransferStore.getState().transfers;
|
||||
const failedIds = pending.transferIds.filter(
|
||||
(tid) => transfers.get(tid)?.state === 'failed',
|
||||
);
|
||||
for (const tid of failedIds) {
|
||||
const retryIds = pending.transferIds.filter((tid) => {
|
||||
const s = transfers.get(tid)?.state;
|
||||
return s === 'failed' || s === 'aborted';
|
||||
});
|
||||
// Flip the bubble back to 'sending' first so the orchestrator
|
||||
// re-evaluates after the resumed transfers complete.
|
||||
usePendingMessageStore.getState().markSending(pending.clientId);
|
||||
for (const tid of retryIds) {
|
||||
await useTransferStore.getState().resumeUpload(tid);
|
||||
}
|
||||
usePendingMessageStore.getState().markSending(pending.clientId);
|
||||
}}
|
||||
className="px-2 py-0.5 rounded-md text-[11.5px] font-medium text-accent-mint bg-accent-mint/10 hover:bg-accent-mint/20 transition-colors"
|
||||
>
|
||||
|
||||
@@ -258,8 +258,11 @@ export function MessageInput({ channelId, channelName }: MessageInputProps) {
|
||||
// bytes get cleaned by the storage janitor (per docs/systems/uploads.md).
|
||||
useTransferStore.getState().remove(transferId);
|
||||
} else {
|
||||
// abortUpload sets state='aborted' and tears down the live tus instance.
|
||||
// Tear down the live tus instance, then drop the transfer + free the
|
||||
// retained File reference. (abortUpload alone leaves the record in the
|
||||
// store for retry-after-abort; here the user is fully discarding.)
|
||||
abortUpload(transferId);
|
||||
useTransferStore.getState().remove(transferId);
|
||||
}
|
||||
removeStaged(channelId, transferId);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user