Conversation
`measureStatus` in `TasklistStateDTO` now checks `revision.tasks.measure` before the `isUpdate` guard, so an in-progress revision task takes priority over the update/unchanged fallback. A task with `lookupTableUpdated: false` returns `NotStarted` (lookup needs to be re-uploaded), and `lookupTableUpdated: true` returns `Updated`. Without a task the existing `isUpdate → Unchanged` / `joinColumn → Completed` logic is unchanged. `getPreviewOfMeasure` now forwards `draftRevision.tasks` to `getMeasurePreview`, so when a revision has an outstanding measure task the preview renders the raw fact-table column rather than the stale lookup table. The `revisionTasks` parameter type is widened to `RevisionTask | null` to accommodate the optional-chained value. Tests added for: - `measureStatus` returning `NotStarted`/`Updated` based on the task's `lookupTableUpdated` flag (overriding `isUpdate`) - `getMeasurePreview` treating an explicit `null` for `revisionTasks` the same as `undefined`
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves how measure-related revision tasks affect publisher UX by prioritizing revision task state in the tasklist and ensuring the measure preview doesn’t show stale lookup-table data during an in-progress revision.
Changes:
- Update
TasklistStateDTO.measureStatusto preferrevision.tasks.measure.lookupTableUpdatedover theisUpdate → Unchangedfallback. - Forward
draftRevision.tasksintogetMeasurePreviewso measure preview can bypass the lookup-table path when a revision measure task exists. - Add unit tests covering task-driven
measureStatusoutcomes andnullhandling forrevisionTasksingetMeasurePreview.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/dtos/tasklist-state-dto.ts |
Prioritizes revision measure task state (NotStarted/Updated) over update fallback logic. |
src/controllers/measure.ts |
Passes draftRevision.tasks into getMeasurePreview to render an accurate preview during revisions. |
src/services/measure-handler.ts |
Widens revisionTasks parameter type to allow null from optional-chained callers. |
test/unit/dtos/tasklist-state-dto.test.ts |
Adds tests verifying measureStatus returns NotStarted/Updated based on lookupTableUpdated. |
test/unit/services/measure-handler.test.ts |
Adds test verifying null revisionTasks behaves like “absent” tasks. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
wheelsandcogs
approved these changes
Jun 4, 2026
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
measureStatusinTasklistStateDTOnow checksrevision.tasks.measurebefore theisUpdateguard, so an in-progress revision task takes priority over the update/unchanged fallback. A task withlookupTableUpdated: falsereturnsNotStarted(lookup needs to be re-uploaded), andlookupTableUpdated: truereturnsUpdated. Without a task the existingisUpdate → Unchanged/joinColumn → Completedlogic is unchanged.getPreviewOfMeasurenow forwardsdraftRevision.taskstogetMeasurePreview, so when a revision has an outstanding measure task the preview renders the raw fact-table column rather than the stale lookup table. TherevisionTasksparameter type is widened toRevisionTask | nullto accommodate the optional-chained value.Tests added for:
measureStatusreturningNotStarted/Updatedbased on the task'slookupTableUpdatedflag (overridingisUpdate)getMeasurePreviewtreating an explicitnullforrevisionTasksthe same asundefined