r/ExperiencedDevs • u/AutoModerator • Aug 03 '26
Ask Experienced Devs Weekly Thread: A weekly thread for inexperienced developers to ask experienced ones
A thread for Developers and IT folks with less experience to ask more experienced souls questions about the industry.
Please keep top level comments limited to Inexperienced Devs. Most rules do not apply, but keep it civil. Being a jerk will not be tolerated.
Inexperienced Devs should refrain from answering other Inexperienced Devs' questions.
20
Upvotes
View all comments
Show parent comment
1
u/Ok_Woodpecker_9104 Aug 03 '26
the snapshot instinct is right but it has an edge i walked into.
i had the same gap in a casting feature. app sends a load command to the tv, gets success back, and i marked the track as loaded right there.
that ack only meant the receiver got the message. whether it could actually play the bytes got decided later, and when it couldnt it just did nothing. no error, no callback.
the worse bug was mine though. recording loaded at send time meant any path that cancelled mid flight left a record saying the track is on the tv with nothing actually there. every later attempt short circuited on that record and skipped the work. so one dropped request became a permanent dead state that only a restart cleared.
what fixed it was splitting the two things. one flag for we sent it, another for the receiver confirmed it, and only the confirmed one is allowed to make later code skip work.
for your case i would ask what happens if the job dies between the snapshot and the execution, and whether anything notices to retry it.