Repository navigation
Conversation
A course-link with no text stores a placeholder for its target's title, filled in when the linking resource is sent. The linking resource's checksum covers the placeholder, not the title, and the planner reapplied consumers only when their producer was a replacement create. A rename is an update, so every link to a renamed page kept the old title on Canvas. An update now counts as a rename when its title differs from the title in the ledger, or when either is unknown. A rename reapplies the consumers that read a field other than the Canvas id, and they wait for it, so they read the new title and uri. An update that keeps its title reapplies nothing: re-sending a quiz that has submissions asks an instructor to save it again by hand. Two renamed resources that read each other cannot both go second, so ordering edges between renames inside a cycle are dropped. Tests: a rename reapplies its linker after it and not a consumer that reads only the id; a body edit reapplies nothing; two renamed pages that link to each other plan without a cycle. Four mutants (every update counts as a rename; renames reapply nothing; no ordering after a rename; mutual renames keep their cycle) each fail one of them. A dry run of CS 312 against its test course plans the same 280 changes with and without this commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
Contributor
Author
|
Closing in favor of #164, which fixes this in 0.8.15. |
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.
In mdxcanvas, one page can link to another with
<course-link type="page" id="..."/>. When the tag has no text of its own, the link shows the target page's title, which mdxcanvas fills in when it sends the linking page to Canvas.Update the link text on other pages when a page is renamed
Why: When we rename a page in the course, the links to it on other pages need to show the new title. We observed that the link titles remained stale while previewing CS 312 page updates on the test course. The renamed page showed its new title, and the four pages linking to it kept the old one. mdxcanvas re-sends a linking page only when its own source changes or when the page it links to is newly created, and a rename is neither.
What: A rename now re-sends every resource whose links show the renamed resource's title or point to its address. Those resources are sent after the renamed one, so they pick up the new title. mdxcanvas detects a rename by comparing the new title with the title it recorded from Canvas the last time it sent that resource. If either title is unknown, it treats the update as a rename. An edit that keeps the title re-sends nothing extra, because re-sending a quiz that has submissions makes an instructor open it and save it again by hand.
You may see a better way to fix this, and I'm open to suggestions.
This changes the same lines of
planner.pyas PR #160. Whichever lands second, I'll resolve the overlap. The changelog entry is under Unreleased, so the version number is yours to pick.Three new planner tests cover a rename, an edit that keeps the title, and two renamed pages that link to each other. Taking out each part of the fix makes one of them fail, and a dry run of CS 312 plans the same changes with and without it.