Pair Promise.allSettled() outcomes with a captured copy of the input list. The records keep input order even when an image job started earlier finishes later.
Use the status field before reading a result. A fulfilled record has a value; a rejected record has a reason. Keep the corresponding source identifier with either kind of record so a failed image job is not silently removed from the batch report.
The returned order does not impose a concurrency limit or establish that a produced image was downloaded by the user. Those are separate parts of the workflow. If the interface permits another selection while work runs, keep the running batch's list unchanged.
Before showing the summary, compare the number of outcome records with the captured input list. Display failures alongside successful jobs, with wording that describes what the application actually confirmed.
Reference: MDN Promise.allSettled()
Published by Morphio as part of our practical image workflow notes.
Top comments (0)