fix(page-status): correctly classify BYOM pages when sourceLastModified is null/absent#369
Open
somarc wants to merge 2 commits into
Open
fix(page-status): correctly classify BYOM pages when sourceLastModified is null/absent#369somarc wants to merge 2 commits into
somarc wants to merge 2 commits into
Conversation
Contributor
Code ReviewFiles Reviewed
Issues FoundCONSIDER:
Recommendation: If the file is kept, add it to What's Good
VerdictAPPROVE — the bug fix is correct, well-tested, and cleanly refactored. One optional cleanup item on |
0e3266a to
4004cb2
Compare
shsteimer
reviewed
May 14, 2026
| const previewDate = new Date(preview ?? NaN); | ||
| const publishDate = new Date(publish ?? NaN); | ||
|
|
||
| if (!valid(editDate)) { |
Collaborator
There was a problem hiding this comment.
the edit date may not be valid for non-byom (sharepoint/gdrive authoring) in those cases, non valid edit date indicates the file was deleted from source, and I think we should try to preserve that warning.
shsteimer
requested changes
May 14, 2026
…ed is null/absent Fixes #340. Pages without a source date (e.g. BYOM) were always shown as "No source" (negative) regardless of their preview/publish state. The fix extracts the classification logic into a pure helper (status.js) that falls through to preview/publish sequencing when no edit date is present — null and undefined are both treated as absent via the `?? NaN` guard. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
e09c4c1 to
38e48d5
Compare
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.
Summary
sourceLastModifiedwere always shown as No source (negative/red), even when fully previewed and publishedbuildSequenceStatus()into a new pure moduletools/page-status/status.js→classifySequenceStatus(), making it independently testableeditis null/absent (null ?? NaNguard ensures both are treated as Invalid Date), classification falls through to preview/publish state instead of immediately returning negativetests/tools/page-status/status.test.js— 10 tests parametrized over[undefined, null]covering the full no-source matrix plus 5 with-source regression paths (100% branch coverage)Classification matrix (no source date)
Preview
Branch preview of the page-status tool:
https://fix-page-status-byom-no-source--helix-tools-website--adobe.aem.page
Test plan
npm run lint— passesnpm test— 430 tests pass,status.jsat 100% branch coverageCurrent/Pending changes/Not publishedinstead ofNo source🤖 Generated with Claude Code