Repository navigation
Conversation
The old pattern started with the blank lines before the doc line, so from inside a long run of them it re-read the run at every position: 200,000 blank lines took about a minute. Now it matches only the doc line and trims the blank lines before it from the end.
This branch has not been deployed
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.
This keeps an event with a long run of blank lines (newlines or
<br>tags) in its description from freezing a course home. Like #2060, it's about event text any signed-in account can write. Since #2061, the ticker on course homes reads each upcoming event's description to find its linked doc, theLinked doc: <url>line at the end.varchar(255), which MySQL enforces but SQLite doesn't, and Spring's code doesn't check the length. Spring uses SQLite whenDB_URLisn't set, and its README says production is on SQLite right now.splitLinkedDocin_projects/systems/calendar/js/CalendarDocLinks.jsused one regex for the doc line and the blank lines before it. When the doc line didn't come right after a long run of blank lines, it started over at each one and read to the end of the run, so twice the lines took about four times as long.Linked doc:line, and a small loop takes the same whitespace and<br>tags off the end of the text before it, reading each one once.<br>tags, links andLinked doc:lines, and they all split the same way./student/calendar), when you open an event and again when you click Edit, so it had the same problem.Other notes:
CalendarDocLinks.js._projects/systems/calendar/tests/doc_links.test.mjs: long runs of blank lines have to split in under 100 ms, the doc line is still found after them, and<br/>,<br />and<BR>count as line breaks. With main's version the speed test failed after about a minute.node --test tests/calendar_doc_links.test.mjs tests/calendar_ticker.test.mjs tests/calendar_safe_html.test.mjspasses.AGENTS.mdandAGENTS_MD_DOCUMENTATION.md.How to try it:
fix/doc-link-regexfromsvaka2000/Pages-JJ.node --test tests/calendar_doc_links.test.mjs. It passes in under a second.