DEV Community

Miran
Miran

Posted on

A Shift Confirmation Is Useless If the Assignment Changes Under It

I started treating a stable assignment as a precondition for confirmation, because otherwise a perfectly valid response can belong to an outdated shift.

A stable assigned cleaning shift with faded earlier time and location versions behind it, showing that confirmation should begin only after the assignment stops changing
A cleaner can confirm a shift perfectly and still leave me with the wrong answer.

Imagine I ask Maria to confirm:

Friday
6:00 PM
North Park office
Enter fullscreen mode Exit fullscreen mode

She presses Confirm.

Then the working schedule changes to 7:00 PM before the team is finished planning.

I now have a real confirmation. It just belongs to an assignment that is no longer current.

That possibility changed how I think about the beginning of a confirmation workflow.

The first step isn't sending the confirmation request.

It's deciding that the assignment is stable enough to ask the question.

I needed a precondition before the response

For the current workflow, an assigned shift already contains the basic facts the cleaner is responding to:

Assigned cleaner
Date
Start and end time
Client or location
Enter fullscreen mode Exit fullscreen mode

Those aren't decoration around a confirmation button.

They define what the cleaner is actually accepting.

If one of them is still moving, asking for a response too early creates a stale-answer problem.

That means the sequence I want is closer to:

Working schedule is ready

Create or import assigned shifts

Check names, dates, times, and locations

Ask the assigned cleaner to confirm
Enter fullscreen mode Exit fullscreen mode

rather than:

Create rough assignment

Ask for confirmation

Keep editing assignment

Hope everyone understands the latest version
Enter fullscreen mode Exit fullscreen mode

This is why the first steps in the cleaning shift confirmation workflow happen before the cleaner response.

The schedule has to be ready enough that the thing being confirmed has a useful meaning.

This isn't a database lock

I don't want to make the implementation sound more sophisticated than it is.

I'm not describing a distributed transaction, versioned scheduling engine, or automatic freeze on every assignment.

For the current product, this is mainly a workflow boundary.

CleanConfirm starts with shifts that the team has already planned elsewhere. Owners or admins can create those assigned shifts or bring them in through CSV, then use the product for the confirmation work that follows.

So the practical safeguard is simple:

don't start asking cleaners to confirm while the team is still actively rearranging those assignments.

That does leave responsibility with the person preparing the schedule.

They need to check that the cleaner, date, time, and location match the working plan before confirmation begins.

For a focused MVP, I prefer making that requirement explicit over pretending the product owns a complete scheduling synchronization problem that it doesn't actually solve.

A response needs context to stay meaningful

This also made me look differently at the Confirmed label.

On its own, it sounds almost like a property of the cleaner:

Maria = Confirmed
Enter fullscreen mode Exit fullscreen mode

But that's not what I want it to mean.

The useful record is much closer to:

Maria
confirmed
Friday at 6:00 PM
at North Park office
Enter fullscreen mode Exit fullscreen mode

The response belongs to one assigned shift.

That distinction matters when the same cleaner has several jobs in a week. Someone confirming Tuesday morning tells me nothing about Friday evening.

It also matters when a schedule changes.

If the Friday assignment is materially changed after Maria responded, I shouldn't mentally carry that old yes forward just because her name is still attached somewhere.

The thing she saw matters.

This is one reason I like keeping confirmation attached to the assigned shift rather than treating it as a general availability flag.

The response has meaning because the assignment gives it context.

Sending something doesn't solve the stale-answer problem

There is another tempting shortcut here.

A system sends a confirmation message successfully, so the workflow feels like it has moved forward.

But sending the message answers a different question.

It tells me that a send attempt happened.

It doesn't tell me that the cleaner explicitly accepted the assignment, and it definitely doesn't fix an assignment that was still changing when the message went out.

So I want these events to remain conceptually separate:

Assignment prepared

Confirmation requested

Cleaner responded

Current assignment is confirmed
Enter fullscreen mode Exit fullscreen mode

Each one removes a different kind of uncertainty.

Skipping the first one makes the later events much less useful.

The failure I want to avoid is a believable answer to an obsolete question

This isn't the dramatic kind of bug that throws an exception.

Nothing necessarily crashes.

The button works.

The response saves.

The cleaner did exactly what the interface asked.

That's what makes the problem more interesting.

A stale confirmation can look completely valid.

The failure comes from asking for a decision before the object being decided on is ready.

For the current version, I don't need a huge rules engine to deal with that.

I need a clear starting condition:

the working assignment should be settled before confirmation begins.

After that, Unconfirmed means something useful.

Confirmed means something useful.

And if the cleaner says they cannot make that specific assignment, the team can move into the cover process with the right shift still attached.

Sometimes the safest validation happens before the user ever sees the button.

Top comments (0)