forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on dcf123a8823bd55f0a656ce94de6b865f41dc08aFiltered to src/api/__tests__/client/client.test.tsClear filter

2026-09-15

fix: 🧩 handle switched-off school modules without blank screens - client tags 403 {error, module} as a module refusal and notifies the modules context, which refetches so nav and gates catch up mid-session; the list is also re-read when a tab comes back after a minute - ModuleGate shows a switched-off card for pages of an off module (routeModule maps paths to modules) instead of a page that can only 403 - homepage and shell feed skip off modules and wait for the module list; refusals read as no data, off-module tiles and panels are left out - class nav entries now carry the classes moduleBurak Boduroğlu · be0d677
fix: 🧩 handle switched-off school modules without blank screens
- client tags 403 {error, module} as a module refusal and notifies the
  modules context, which refetches so nav and gates catch up mid-session;
  the list is also re-read when a tab comes back after a minute
- ModuleGate shows a switched-off card for pages of an off module
  (routeModule maps paths to modules) instead of a page that can only 403
- homepage and shell feed skip off modules and wait for the module list;
  refusals read as no data, off-module tiles and panels are left out
- class nav entries now carry the classes module

2026-08-01

perf: ⚡ coalesce overlapping GET requests in the api client - in-flight identical GETs share one promise (keyed by path + cache mode); settled entries are dropped, so this is not a cache and refetches still reach the backend - skips POST/PATCH/DELETE, bodied GETs, AbortSignal, and no-storeBurak Boduroğlu · c35a83a
perf: ⚡ coalesce overlapping GET requests in the api client
- in-flight identical GETs share one promise (keyed by path + cache
  mode); settled entries are dropped, so this is not a cache and
  refetches still reach the backend
- skips POST/PATCH/DELETE, bodied GETs, AbortSignal, and no-store

2026-07-28

fix(api): 🚫 sanitize unmapped error messages — no raw backend text leakBurak Boduroğlu · 7a1b27e
fix(api): 🚫 sanitize unmapped error messages — no raw backend text leak

- replace sentenceCase fallback with safe localized generic
- avoids exposing raw English/technical backend errors to users
- update tests to match new messages
fix: 🛡️ guard runtime errors, storage failures, and guest dashboard edge cases - catch TypeError (network/runtime/provider errors) in formatApiError with user-friendly messages instead of exposing raw JS error text - guard localStorage writes behind try/catch so blocked/full storage does not break preferences for the session - restructure DashboardPage so RouteGuard wraps content; add guest redirect testBurak Boduroğlu · 8b9f154
fix: 🛡️ guard runtime errors, storage failures, and guest dashboard edge cases
- catch TypeError (network/runtime/provider errors) in formatApiError with
  user-friendly messages instead of exposing raw JS error text
- guard localStorage writes behind try/catch so blocked/full storage does not
  break preferences for the session
- restructure DashboardPage so RouteGuard wraps content; add guest redirect test

2026-07-25

fix: 🔍 correct 21 defects the last 24h of commits shipped greenAhmet Kaan Gümüş · f9efbbc
fix: 🔍 correct 21 defects the last 24h of commits shipped green

Adversarial audit of 49f9928..ffb1d47: four verifiers found 15 defects the
317-test suite passed over, and a two-lens panel found 6 more in the fixes
themselves. Three of those commits claimed fixes they did not deliver.

- exam room: "saved" was still a lie. Acks were keyed on question_id alone,
  so a timed-out send's late frame settled the retry and the badge claimed
  Saved for a payload the server never took. Replaced with per-send FIFO
  plus an integer debt count per question: superseded/timed-out sends are
  disowned and their frames paid off before any live send settles. failAll
  now takes a required cause — an unattributed error frame keeps the debt
  (the socket stays open), only a real close clears it
- shell feed leaked across accounts: the provider outlived logout, so user B
  saw user A's inbox, badge and appointments until the refetch landed. The
  feed is now built inside a memo keyed on the user id, so a switch disposes
  it rather than relying on a mutate call
- appointments offered actions the backend rejects: book on in-progress
  slots (list filter used where the book guard applies), and a teacher lost
  reschedule permanently because the backend never clears proposed_* — action
  availability now derives from a standing proposal, in a tested pure gate
- every 403 and 404 message was dead: formatApiError returned the per-status
  generic before consulting the table, so entries added for the question bank
  never rendered. Table now wins; 8 appointment 409s and the refresh-from-bank
  400 localized against the backend's exact strings
- request deadline escaped as a raw DOMException because the body read sat
  outside its try, showing Turkish users an English abort message
- unread badge under-counted from a capped inbox page, the two shell badges
  disagreed, and dismiss-all could not clear a count above ten
- students and parents saw their own name on every calendar appointment
- question bank stranded the user on an empty page after deleting the last row
- tests: 317 -> 336, all new ones watched failing before they passed. One
  existing test asserted the ack bug as intended behaviour and was rewritten
- comments in create-ack-waiter claimed safety properties the code lacked;
  rewritten to describe actual behaviour

Known and accepted: shell events/exams fetch unpaged (~3.37MB/poll at 5000
rows) because the backend cannot express a schedule window. Follow-ups for
the backend: starts_after on /events and /exams, and a client seq echoed in
the exam ws saved/error frames to replace the debt heuristic with exact
identity.
fix: 🇹🇷 localize the settings duplicate-entry errorAhmet Kaan Gümüş · a8053b3
fix: 🇹🇷 localize the settings duplicate-entry error

- the backend now rejects two settings entries that are the same word
  apart from Turkish casing (İZİN vs izin); without a mapping a Turkish
  admin saw "İşlem tamamlanamadı: <raw English>"
- map both the exam_kinds and attendance_statuses strings, EN and TR,
  with a test pinning the exact backend wording

2026-07-24

feat: 🏦 school-wide question bank with two-way exam bridgesAhmet Kaan Gümüş · 0f9e79a
feat: 🏦 school-wide question bank with two-way exam bridges

- mirror the backend bank contract: src/api/bank-questions (create/list/
  read/update/delete, question + per-choice image upload/fetch/delete)
  with types, BANK_QUESTION_LIMITS, and full API tests
- bridges in src/api/exams: postExamQuestionFromBank instantiates a
  template into an exam, postExamQuestionToBank saves an exam question
  back as a template; add the missing getExamChoiceImageBlob
- /question-bank page, teacher+ guarded: subject and owner filters,
  side-panel create/edit, confirm delete, nav item
- exam questions panel gains "Add from bank" (hidden once read-only,
  since from-bank mutates the exam) and a per-row "Save to bank" that
  stays available on finished exams — saving copies out, it never
  touches the exam
- repeat saves confirm first and relabel to "save another copy": the
  copies are independent, editing one never changes the other
- generalize question-form for both flows instead of forking it: widen
  initial to a structural type, pass image sources as props
- fix: correct answer was sent as a pre-compaction index, so blanking a
  choice above it silently moved the answer key on graded exams; remap
  by row identity and block submit when the marked choice is blanked
- fix: a PATCH carrying choices wipes every per-option image server-side
  and the exam path never restored them; one shared choice-compaction
  helper now re-uploads at post-compaction slots and names the options
  it could not carry over
- fix: removeChoice left correct pointing at the row that slid into the
  deleted slot
- read the question count off .latest so the new refetch paths cannot
  blank the panel
- localize the bank 403/409 strings; EN/TR throughout
fix: 🗓️ stacked slot date/time cell + localized overlap errors - appointments: split the crammed one-line "date time – time" column into a stacked cell (date over clock range, mono + tabular-nums so digits align); drops the clipped end-time, narrows the column - add formatDate (date-only) helper - localize the three slot-overlap 409 messages (EN/TR) so they stop rendering half-Turkish/half-English; test the exact backend strings mapAhmet Kaan Gümüş · 8bba96b
fix: 🗓️ stacked slot date/time cell + localized overlap errors
- appointments: split the crammed one-line "date time – time" column
  into a stacked cell (date over clock range, mono + tabular-nums so
  digits align); drops the clipped end-time, narrows the column
- add formatDate (date-only) helper
- localize the three slot-overlap 409 messages (EN/TR) so they stop
  rendering half-Turkish/half-English; test the exact backend strings map

2026-07-22

fix: 🐛 PDF note import and API validation errorsBurak Boduroğlu · 9801748
fix: 🐛 PDF note import and API validation errors

- replace custom PDF text parsing with lazy-loaded Mozilla PDF.js

- keep note import save/read errors visible inside the side panel

- localize backend max-length validation messages app-wide

- add PDF import and API error formatter coverage
feat: 📎 client-side upload limits and shared error handling - extract formatBytes/maxUploadBytes into shared src/lib/upload-limits.ts - add client-side file size validation in exam room, question form, solution form, and ask-question dialog - add known API error messages for file upload, exam, event, and pomodoro errors - extract errorMessageFromPayload helper for client/form/blob endpoints with Pydantic validation detail support - add status-code handling for 409, 413, 422 - show max file size in question/solution upload UIBurak Boduroğlu · fed2a93
feat: 📎 client-side upload limits and shared error handling
- extract formatBytes/maxUploadBytes into shared src/lib/upload-limits.ts
- add client-side file size validation in exam room, question form, solution
  form, and ask-question dialog
- add known API error messages for file upload, exam, event, and pomodoro
  errors
- extract errorMessageFromPayload helper for client/form/blob endpoints
  with Pydantic validation detail support
- add status-code handling for 409, 413, 422
- show max file size in question/solution upload UI

2026-07-21

chore: 🧪 migrate tests from bun:test to vitestBurak Boduroğlu · b0a9db1
chore: 🧪 migrate tests from bun:test to vitest

- replace bun:test imports with vitest in all 3 test files
- add vitest.config.ts with @ alias and test config
- add vitest dev dependency and test/watch npm scripts
- create src/api/__tests__/ directory for future API tests