The recurring-checklist reset cron queries
resetInterval: { $exists: true, $nin: [null, 'none'] } on every tick, and with
no index that read the whole checklists collection (about 45,000 documents on
the reporting instance), reported as db.collection-scan on Admin Panel ->
Problems. A partial index on resetInterval, like the one #6825 added for
recurring cards, holds only the recurring checklists.
Thanks to Raymond-Voogt and xet7 !
Fixes#6899.
Add optional checklist dueAt with the shared selected-calendar picker and badge. Return checklist and item deadlines from checklist and single-card GETs. Accept validated timezone-qualified ISO deadlines in checklist/item POST and PUT; null clears, omission preserves. Keep existing write permissions and ownership checks. Node regression and Chromium save/clear test pass.
Thanks to rmb82 and xet7 !
Fixes#6693,
The checklist's own action popup (checklistActionsPopup) had reset,
hide-checked, hide-all and export/edit-as-text actions but no way to bulk
check or uncheck every item at once - #4218's "Edit as text" only offers an
indirect workaround (replace every "[ ]"/"[x]" by hand). Checklists.
checkAllItems()/uncheckAllItems() already existed as model helpers used by
the Rules automation (server/rulesHelper.js), so this wires the same two
methods to new menu entries, and extracts the item-selection logic they
share into a pure, unit-testable helper (models/lib/checklistBulkCheck.js).
Thanks to justinr1234 and xet7 !
Closes#2473,
A checklist can now be set to automatically uncheck all of its items on a
recurring schedule via Checklists.resetInterval ('none' by default, or
'daily'/'weekly'/'monthly') and Checklists.lastResetAt. The due-date
arithmetic is a pure, unit-tested module
(models/lib/checklistResetSchedule.js), and the periodic scan
(server/checklistResetSchedule.js) reuses the existing quave:synced-cron
infrastructure server/scheduledRules.js already registers a job on, running
hourly to uncheck items of checklists whose interval has come due.
Thanks to travelg and xet7 !
Closes#3818,
Closes#4729.
models/lib/checklistTemplateCopy.js pulls the "copy a checklist/item
document onto another card" logic out of Checklists.copy() /
copyAllFromCardToCard() (#4017) into plain, Meteor-free functions -
the same split already used for subtask copying
(models/lib/subtaskCopy.js) and bulk checklist-item text editing
(models/lib/checklistItemsAsText.js) - so the copy semantics are unit
tested directly: the copy reproduces the source's checklist/item
content, drops the source _id (a fresh one is assigned on insert),
re-homes onto the destination card/board, places an appended checklist
after the target's own (existing checklists are read but never
mutated), and forces a copied item unchecked when resetChecked is set
while leaving the default (ordinary "Copy Checklist" / card copy)
behaviour unchanged. Checklists.copy() and copyAllFromCardToCard() now
call these builders instead of repeating the field-by-field copy
inline; behaviour is unchanged (the full node suite's existing
checklist tests still pass).
Thanks to Th0mas89 and xet7 !
Checklists.copy() now takes an options.resetChecked flag so a copied
item can be forced unchecked regardless of its source isFinished state,
and a new Checklists.copyAllFromCardToCard(sourceCardId, targetCardId)
appends every checklist of a source (e.g. template) card onto a
destination card's existing checklists, in source order, without
touching what is already there. Both are used by the new "Copy
Checklist From Template" card action (client/components/cards/checklists.js
and .jade), which reuses the same board/swimlane/list/card picker as
Move/Copy Checklist.
Thanks to Th0mas89 and xet7 !
Closes#4017,
Reported by email against 10.91: "Still slow on loading cards. Test server with
me as only user." One user is the part that says what it is not: with nobody
else on the server there is no contention, no queue and no lock, so the time is
going into the queries themselves.
It was. cards, activities, cardComments, checklists and checklistItems - every
collection a board draws and an opened card pulls in - had NO index at all.
"The cards of this list", "the comments of this card", "the newest activities of
this board" each walked the whole collection. That is invisible on a demo board
and expensive on a real one, and worse on FerretDB, whose SQLite backend has to
walk the same documents. The activities publication even explains that it keeps
its selector flat so it can push down to FerretDB's index; there was no index
for it to push down to.
Each index matches a selector the app really makes WITH the sort it really uses
- boardId+archived, listId+sort, swimlaneId+sort, parentId, boardId+cardNumber
for cards; cardId+createdAt and boardId+createdAt for activities and comments;
cardId+sort and checklistId+sort for the checklists - because an index on the
filter alone still leaves an in-memory sort of everything it matched, which on a
board with a year of history is the slow half.
They go through the same idempotent ensureIndex every other index here uses: it
waits for the replica-set primary, does nothing when the index is already there,
and logs a backend that refuses one instead of stopping the server.
tests/cardQueryIndexes.test.cjs pins the set, and that each one carries the sort
as well as the filter.
Thanks to xet7 !
Reported by email with a screenshot (Swedish): "Även om jag avmarkerar 'Visa på
minikort' (och vill dölja checklistan på minikortet)" - the switch is off and the
checklist is on the minicard anyway.
It was off for everybody. The minicard asked:
board.allowsChecklistsOnMinicard || checklist.showChecklistAtMinicard
and the board flag defaults to TRUE. An OR cannot be argued with: while the board
setting is on, no value of the checklist's own field changes the answer. The popup
made it look like a working switch - it drew the state from the raw field, which
starts false, so it read OFF beside a checklist that was plainly showing, and
clicking it wrote true and changed nothing visible. Clicking again wrote false and
changed nothing either. Dead in both directions, which is exactly what the
screenshot shows.
The two settings are a DEFAULT and an OVERRIDE, not two ways of saying yes:
showChecklistAtMinicard === true -> shown, whatever the board says
showChecklistAtMinicard === false -> hidden, whatever the board says
showChecklistAtMinicard undefined -> follow the board's default
An override needs three states, so the field loses `defaultValue: false`: with
every checklist born false, "hidden" and "not chosen" are the same value and the
override cannot exist. models/lib/minicardChecklistVisibility.js is the one rule,
used by the minicard, the popup's switch and the toggle - and the toggle now flips
what is ON SCREEN rather than the raw field, because flipping the field is what
made the first click do nothing.
Checklists written under the old default carry a false that meant "follow the
board". Left alone under the new reading it would mean "hide this one" and every
checklist would vanish from every minicard - the mirror image of the bug. The
schema-upgrade step checklist-minicard-unset clears exactly those, and it is the
one step there that must run ONCE EVER rather than once per version: afterwards a
stored false is somebody's choice, and re-running would put their checklists back.
It keeps its own marker beside the schema-upgrade one for that.
tests/minicardChecklistVisibility.test.cjs covers the reported case, the opposite
one, that two clicks return to the board default, and that only true and false are
opinions - a string, a number or a null from an old REST client or a bad import
must not quietly mean "hide". tests/schemaUpgradeSteps.test.cjs gains the step,
including the negative: after it has run, a false set by a person survives the next
release.
Verified by running both suites and the whole node suite (377 suites, 0 failed).
Not verified in a browser: this sandbox has none.
Thanks to xet7 !
Checklist.copy() duplicated each checklist item with the hooked insertAsync, so
collection-hooks fired each item's after.insert — every one doing a getCard and
inserting an addChecklistItem activity. Copying a card with ~100 items meant
~100+ activity inserts plus per-item DB round-trips, taking minutes and spiking
CPU. The copy now uses .direct for the checklist and its items (skipping the
per-item activity hooks, which are pure churn for a wholesale copy) and sets
boardId itself — the same approach as the cardRemover delete path.
Copy regression (checklist + all items duplicated, correct boardId/checklistId)
in tests/playwright/specs/17-rest-api.e2e.js. Also documents #5388 (list
collapse now per-user) as verified-resolved.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The 'Hide checked items' state is now read per checklist (from that checklist's own
hideCheckedChecklistItems field) and an item is hidden exactly when it is checked
and that checklist's toggle is on — so toggling one checklist no longer affects the
others and the direction is no longer inverted. Pure isItemHidden helper unit-tested.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
visible until logout/login.** The `board` publication batched checklists,
checklist items, comments and attachments into board-level cursors filtered by
`cardId: { $in: cardIds }`, where `cardIds` was a one-time snapshot. In
`reywood:publish-composite` a child cursor only re-runs when its parent (the
board) document changes, so the snapshot never refreshed when a card was added
— a checklist on a card created after subscribing matched no published card and
only appeared on the next subscribe (logout/login). This was a regression from
the "Optimized board loading" change, which had replaced the original reactive
per-card child cursors with these batched snapshots. Fixed by **denormalizing a
`boardId` field onto `Checklists` and `ChecklistItems`** so they can be
published with a single board-level cursor filtered by `boardId` — one cursor
per collection (keeping the load optimization) that still reacts to checklists
on newly added cards, because a new checklist is created already carrying the
board's id. `boardId` is set on insert (server `before.insert` hooks, plus
explicitly in the Trello/WeKan board importers, which use `direct.insert` and
bypass hooks), re-derived when a checklist/item or its card moves to another
card (`before.update` on `cardId`) or the card moves to another board
(`Cards.after.update` cascade), and backfilled for existing data by an
idempotent startup migration. New `{ boardId: 1 }` indexes were added on both
collections. Comments and attachments instead remain reactive as per-card
children of the cards cursor. Assigned-only board members still only receive
checklists for cards assigned to them (the board-level cursor falls back to the
assigned cards' ids for those roles).
Thanks to ahlgrimma and Claude !
Fixes#6361
conditions are:
- the checklist must have at least 1 checklist item
- all checklist items have to be finished
- the option "hide checked checklist items" is set at card details