Panama-connected work Remote development from the United States
Faith Forge LabsPanama

Why opening a report changed the review queue

A colleague opens a report and returns to a review queue. The records are still present, but their order has changed. Nobody used the queue's reorder command or saved a new sequence.

This fictional operations-board investigation follows that observation to an in-memory change. It uses three invented tasks and separate review and reporting views. The question is whether opening a report should be allowed to alter the operator's working sequence.

Establish the two intended orders

The owner has approved the queue order R-17, R-12, R-23. It reflects a deliberate review arrangement, not a calculation from the tasks' due dates.

A report has a different purpose: show the same records by due date. In the fixture, R-23 is due first, followed by R-17 and then R-12. Both orders are meaningful. Neither should replace the other merely because a person changes views.

Record Approved queue position Report position by due date
R-17 1 2
R-12 2 3
R-23 3 1

Before opening the report, the saved queue and the application's in-memory queue agree. Immediately afterwards, the in-memory queue becomes R-23, R-17, R-12. The stored sequence has not been updated. Reloading the original source restores the approved order.

Find the mutation rather than blaming the records

The report receives a reference to the same array used by the queue. Its preparation calls the array's in-place sort operation. The resulting report order is correct, but the operation has also rearranged the shared array.

The ECMAScript array specification describes sort as an operation on the array itself. The issue is not an incorrect date comparison or a missing record. It is using a mutating operation where the application intended a separate presentation.

That evidence explains the apparently inconsistent behaviour. The database is unchanged, while another view of the same in-memory data has moved. Adding a save operation would make the unintended change durable rather than solve it.

Define the boundary explicitly

The owner confirms that report viewing is read-only with respect to queue order. A deliberate queue-reorder action may change the sequence, subject to the existing permission and save process. Report sorting may not do so.

The repair creates a separate array for the report's presentation and sorts that array. In this fixture, the report comparator reads due-date values without changing the record objects. A shallow array copy is sufficient for the specific order mutation; it would not isolate later edits to shared nested record data. That limitation is recorded rather than described as a universal deep-copy solution.

The source queue retains its original array order. The report holds the same intended record identities in a different sequence. No names, due dates, assignments or task states are changed.

Repeat the actual user sequence

The controlled review begins from R-17, R-12, R-23. Opening the report shows R-23, R-17, R-12. Returning to the queue still shows the approved original sequence. The reviewer compares the stored order, the source array and the report array rather than relying only on two screenshots.

A second report sorts by task identifier. It produces R-12, R-17, R-23 in its own presentation. Neither the queue nor the first report acquires that new order. The three views contain the same identities and field values throughout.

Next, an authorised operator deliberately moves R-23 to the front of the queue and saves through the existing supported operation. The source order becomes R-23, R-17, R-12 because of that explicit action. Opening a report afterwards leaves the new approved queue order intact.

These controls demonstrate both sides of the rule: a report cannot reorder the source, while the legitimate reorder capability remains available.

Inspect exports and downstream assumptions

A report export should use the report's agreed presentation. A queue handover should use the approved queue sequence. The project names those purposes separately so a future change does not reuse whichever array happened to be sorted most recently.

Stable record identity still matters. If an action identifies its target only by a displayed row number, sorting may reveal another defect. That is a separate concern to inspect; this repair does not claim to resolve every possible row-action error. Its acceptance evidence is the source-versus-presentation order boundary.

Leave the cause understandable

The handover records the source owner, the two presentation purposes and the mutating operation that caused the failure. It includes the original three-task fixture and the deliberate-reorder control.

The completed result is modest but concrete: staff can inspect differently ordered reports without disturbing the queue another colleague is using. There is no claim that a new dashboard or replacement platform was necessary. The operations board service can investigate similar disagreements between a useful view and the underlying work.