Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Separate wsm.go into a file for each function | Runxi Yu | 13 days | 1 | -377/+0 |
| | |||||
* | Implement course selection started/stopped states | Runxi Yu | 2024-10-10 | 1 | -0/+30 |
| | | | | Implements: https://todo.sr.ht/~runxiyu/cca/13 | ||||
* | *.go: Update comments | Runxi Yu | 2024-10-09 | 1 | -2/+3 |
| | |||||
* | *.go: Use sync.Map instead of map[int]*courseT for courses | Runxi Yu | 2024-10-09 | 1 | -17/+36 |
| | | | | I'm not sure whether this is actually better than locking. | ||||
* | {courses,wsc,wsm}.go: map[courseGroupT](bool->struct{}) | Runxi Yu | 2024-10-08 | 1 | -4/+4 |
| | | | | | This makes it use slightly less memory. Approximately courseGroupT bits per connection! | ||||
* | *.go: Further wrap errors | Runxi Yu | 2024-10-08 | 1 | -11/+24 |
| | |||||
* | {courses,wsm,wsp}.go: Make course.Selected atomic | Runxi Yu | 2024-10-07 | 1 | -1/+7 |
| | |||||
* | {config,wsm}.go, cca.scfg.example: Configurable immediate propagation | Runxi Yu | 2024-10-06 | 1 | -6/+9 |
| | |||||
* | *.go: Limit to approximately 80 characters per line | Runxi Yu | 2024-10-06 | 1 | -19/+84 |
| | |||||
* | wsm.go: "R" on multiple choices in group rather than closing connection | Runxi Yu | 2024-10-06 | 1 | -4/+5 |
| | |||||
* | wsm.go: Check course group constraint first when choosing | Runxi Yu | 2024-10-06 | 1 | -13/+15 |
| | |||||
* | {courses,wsc,wsm,wsp}.go: Send course number immediately on user interaction | Runxi Yu | 2024-10-06 | 1 | -3/+16 |
| | |||||
* | *: Overhaul structure again and embed everything | Runxi Yu | 2024-10-06 | 1 | -0/+224 |
| | | | | | | | | - Remove sub-Makefiles; recursive make is annoying - Just use one top-level Makefile that builds everything - Embed templates and minified static resources into the binary - Embed all compiled documentation into the binary and serve - Embed all source into the binary and serve | ||||
* | *.go: Move to backend | Runxi Yu | 2024-10-05 | 1 | -224/+0 |
| | | | | And adjust Makefiles, admin handbook, and lint.sh accordingly. | ||||
* | {courses,wsm}.go: Use in-memory structure to fetch cgroup, not SQL | Runxi Yu | 2024-10-05 | 1 | -9/+12 |
| | |||||
* | wsm.go: Omit comparison to bool constant | Runxi Yu | 2024-10-05 | 1 | -1/+1 |
| | |||||
* | wsm.go: Report error when course doesn't exist | Runxi Yu | 2024-10-05 | 1 | -0/+8 |
| | | | | | Luckily we encounter a database error before we have the chance to dereference a null pointer. But it's still good practice to check. | ||||
* | {courses,sem,ws,wsm}.go: Second step towards an efficient state propagator | Runxi Yu | 2024-10-05 | 1 | -1/+1 |
| | | | | References: https://todo.sr.ht/~runxiyu/cca/7 | ||||
* | {courses,wsm}.go: Add getCourseByID | Runxi Yu | 2024-10-05 | 1 | -10/+2 |
| | | | | This also deduplicates some code. | ||||
* | {courses,wsm}.go: Add (*courseT).decrementSelectedAndPropagate | Runxi Yu | 2024-10-05 | 1 | -24/+4 |
| | | | | This is being done quite a few times, so let's make it a function. | ||||
* | {courses,ws,wsm}.go: Update userCourseGroups during choose/unchoose | Runxi Yu | 2024-10-05 | 1 | -2/+30 |
| | |||||
* | {ws,wsm}.go: Handle context cancellations | Runxi Yu | 2024-10-03 | 1 | -0/+20 |
| | |||||
* | {main,ws,wsm}.go: Attempt to cancel old sessions | Runxi Yu | 2024-10-03 | 1 | -15/+15 |
| | | | | | | | | | | | | | | | | | | | When beginning to handle a WebSocket connection, we shall create a new context, with the request context as its parent. We use the new context for everything from now on, except for reporting error messages, which is handled by creating a reportError function in a closure in makeReportError and passing it along to command-handling functions. Note that if one user attempts to rapidly launch WebSocket connections, there might still be a race condition where the old connection hasn't been completely established yet (i.e. an entry hasn't been added to cancelPool) and the new connection isn't able to cancel the old connection. I'm a bit tired to think of a solution now but it could probably be solved by moving the cancellation registration and cancelling sooner during the initial handshake. Note that more parts of the event loop needs to select from ctx.Done (from newCtx) for this to work reliably. | ||||
* | wsm.go, main.js: Use M for number, N for deselect | Runxi Yu | 2024-10-02 | 1 | -3/+3 |
| | | | | | | | Previously both commands used N, and deselection wasn't really implemented on the JavaScript side. It worked and didn't throw an exception but it's technically wrong and the user could see an empty number field for a split second. | ||||
* | {auth,db,wsm}.go: Make 23505 (uniqueness violation) a constant | Runxi Yu | 2024-10-01 | 1 | -1/+1 |
| | |||||
* | wsm.go, main.js: Display the user's selected courses on first runv0.1.0 | Runxi Yu | 2024-10-01 | 1 | -2/+18 |
| | | | | | It's done in the WebSocket routines rather than in the template maker because it's relatively easier to write the logic this way. | ||||
* | {ws,wsm}.go: Split message handlers into their own functions | Runxi Yu | 2024-10-01 | 1 | -0/+177 |