
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Current behavior
In serverSync.js, handleMaxRevs uses findLastIndex to compute two values for deciding whether to set unpublished_changes = true on a channel:
lastChannelEditIndex — the last publishable change, filtered (among other conditions) with c.type !== CHANGE_TYPES.PUBLISHED
lastPublishIndex — the last publish change, matched with c.type === CHANGE_TYPES.PUBLISHED
The predicate for lastChannelEditIndex already includes !c.unpublishable, making the explicit c.type !== CHANGE_TYPES.PUBLISHED check partially redundant: if PublishedChange always set unpublishable: true, the type check would be unnecessary.
Desired behavior
PublishedChange and PublishedNextChange set unpublishable: true by construction (in its constructor in changes.js), so the c.type !== CHANGE_TYPES.PUBLISHED guard in handleMaxRevs can be removed. The !c.unpublishable check alone is sufficient to exclude publish changes from lastChannelEditIndex.
This makes the semantics self-contained in the change object — callers don't need to know the type mapping — and reduces the risk of future change types being accidentally treated as publishable.
Acceptance Criteria
References
Follow-up to #5844 (comment)
AI usage
This issue was drafted with Claude Code assistance from session context and code review.
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Current behavior
In
serverSync.js,handleMaxRevsusesfindLastIndexto compute two values for deciding whether to setunpublished_changes = trueon a channel:lastChannelEditIndex— the last publishable change, filtered (among other conditions) withc.type !== CHANGE_TYPES.PUBLISHEDlastPublishIndex— the last publish change, matched withc.type === CHANGE_TYPES.PUBLISHEDThe predicate for
lastChannelEditIndexalready includes!c.unpublishable, making the explicitc.type !== CHANGE_TYPES.PUBLISHEDcheck partially redundant: ifPublishedChangealways setunpublishable: true, the type check would be unnecessary.Desired behavior
PublishedChangeandPublishedNextChangesetunpublishable: trueby construction (in its constructor inchanges.js), so thec.type !== CHANGE_TYPES.PUBLISHEDguard inhandleMaxRevscan be removed. The!c.unpublishablecheck alone is sufficient to exclude publish changes fromlastChannelEditIndex.This makes the semantics self-contained in the change object — callers don't need to know the type mapping — and reduces the risk of future change types being accidentally treated as publishable.
Acceptance Criteria
PublishedChangeconstructor inchanges.jssetsunpublishable: trueunconditionallyc.type !== CHANGE_TYPES.PUBLISHEDcondition is removed from thelastChannelEditIndexpredicate inhandleMaxRevs(serverSync.js)PublishedChangeinchanges.spec.jspass (updated if needed to assertunpublishable: true)unpublished_changescontinues to be set correctly after a publish event (no regression)References
Follow-up to #5844 (comment)
AI usage
This issue was drafted with Claude Code assistance from session context and code review.