Skip to content

fix(web): tutorials page throws when a tutorial's meeting time is not - #523

Closed
sakethsram8888 wants to merge 1523 commits into
thoth-tech:developmentfrom
sakethsram8888:fix/sj-17
Closed

fix(web): tutorials page throws when a tutorial's meeting time is not#523
sakethsram8888 wants to merge 1523 commits into
thoth-tech:developmentfrom
sakethsram8888:fix/sj-17

Conversation

@sakethsram8888

Copy link
Copy Markdown

Description

Fixes SJ-17: the Tutorials page threw and failed to render entirely whenever
a tutorial's meetingTime wasn't a valid "H:mm" string.

TutorialsComponent.shortTime() did meetingTime.split(':') and then
minutes.padStart(2, '0') with no guard. If meetingTime had no colon
(e.g. a convenor entered '9am'), minutes was undefined and the call
threw a TypeError. If meetingTime itself was undefined, it threw even
earlier on .split(':'). This ran once per row directly in the template
(tutorials.component.html:55) and again inside the Time-column sort
comparator, so a single malformed row took down the whole Tutorial List
screen for every student — not just that row.

shortTime is now total: it returns '' for a falsy input, returns the
raw string unchanged when there's no colon to parse, and only formats when
both an hour and minute part are present. No input can make it throw.

No API-side validation was added meeting_time is a free-text nullable
column by design at that layer, and only the create endpoint validates it,
not update. That's outside this card's scope.

Branches/commits this was built and tested against

  • doubtfire-web: fix/sj-17 @ cfe74dc57, branched from origin/11.0.x @ 6e4c63064
  • doubtfire-api: feature/mobile-notifications @ dc76a5a0e (note: not 11.0.x this repo's checkout was already on this branch and wasn't switched, since the fix is entirely client-side and doesn't touch the API)
  • doubtfire-deploy: fix/local-dev-run @ ab6b0eb

How Has This Been Tested?

Unit tests src/app/projects/states/tutorials/tutorials.component.spec.ts (new file), run in isolation via:
ng test --include=src/app/projects/states/tutorials/tutorials.component.spec.ts --watch=false

Before/after reproduction of the exact original vs. fixed logic (standalone, outside the Angular app, to isolate just the function's behaviour):

Live manual verification, running the app locally against seeded data (COS10001):

  • A normal tutorial list (well-formed times 15:30, 12:30) renders identically before and after this change.
  • Seeded one tutorial's meeting_time to '9am' directly in the dev DB. With the fix applied, the Tutorial List page renders normally and shows 9am in the malformed row's Time column instead of crashing.
  • Clicking the Time column header (which exercises the sort comparator's calls to shortTime) also does not throw with the malformed row present.
  • Reverted the seeded data back to 15:30 afterward.

Note: the pre-fix crash itself was reproduced via the standalone script above (same logic, byte-identical to the original origin/11.0.x implementation) and confirmed by reading the code path, but was not separately re-demonstrated live in the running app with the fix reverted the live check above was done against the fixed code only.

One thing not covered by the automated test: that the malformed row visibly renders inline in the real table in the live app (rather than just that the pure function doesn't throw in isolation) this was checked manually, per above, not via an automated test.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Testing Checklist:

  • Tested in latest Chrome
  • Tested in latest Safari
  • Tested in latest Firefox

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have requested a review from the relevant reviewers on the Pull Request

b0ink and others added 30 commits June 10, 2026 15:23
- students must wait until all tasks have finished processing before clicking on create portfolio
…ms#1263)

* chore: upgrade gantt chart

* feat: add ability to screenshot gantt chart

* chore: fix date formatting

* refactor: enable accurate screenshotting of gantt chart

* chore: improve screenshot name

* chore: extend start date of chart if todays date lands outside
Bumps [@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/config-conventional) from 20.5.3 to 21.0.2.
- [Release notes](https://github.com/conventional-changelog/commitlint/releases)
- [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/config-conventional/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/commitlint/commits/v21.0.2/@commitlint/config-conventional)

---
updated-dependencies:
- dependency-name: "@commitlint/config-conventional"
  dependency-version: 21.0.2
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
* refactor: prevent camera running in background

* refactor: improve ui scaling of tutor mobile view

* chore: improve ui

* fix: ensure scanner works after route loads

* chore: improve ui

* refactor: hide qr scanner in header if already in tutor discussion route

* fix: ensure scanner works after route loads
* feat: submission history

* refactor: improve tab order

* refactor: merge history components

* chore: format

* fix: add task status fallbacks

* fix: manually add back code block styling
* refactor: improve calendar ui/ux

* refactor: improve ui

* chore: add install guide

* chore: correct google calendar

* fix: copy to clipboard

* chore: add mock ics extension

* feat: open web cal from task planner
* feat: engagement passport

* feat: connect engagements to backend

* feat: view engagement comments

* chore: render evidence url

* chore: open engagement dialog from tutor discussion

* chore: format

* refactor: use placeholder text and default note if left empty

* chore: swap occurred at and created at dates

* chore: improve layout

* chore: format

* fix: prevent mobile devices from zooming in on modal inputs

* chore: reorder engagement types

* refactor: rename negative to needs attention
baohuy-tran and others added 29 commits August 19, 2026 21:18
…lexbox

refactor: replace flex-layout with tailwind in extension-comment (doubtfire-lms#1187)
…ooter

refactor: replace flex-layout with tailwindcss in tutor's dashboard footer
…pr33-settings-bootstrap-compat

fix(settings): preserve bootstrap with protected feature flags
* Add GitHub Actions workflow to notify Teams on PRs

* fix(ci): gate the Teams notifier and harden its payload

Adds a job guard so the webhook is unreachable from anonymous fork pull
requests on these public repositories, and so the file is inert if it ever
travels to thoth-tech or doubtfire-lms.

Adds reopened and ready_for_review, which is the transition a reviewer alert
exists to catch, and varies the headline per action so it stays accurate.

Strips Markdown link and code syntax from the title, author and head label
before they reach the channel. Joins on a double newline, which is what Teams
renders as a break. Reports the real HTTP status instead of asserting a
delivery the workflow never checked.

---------

Co-authored-by: Clupai8o0 <clupaio4@gmail.com>
…tify-teams-pr

Refactor Teams notification to use Adaptive Card
Bumps  and [brace-expansion](https://github.com/juliangruber/brace-expansion). These dependencies needed to be updated together.

Updates `brace-expansion` from 5.0.6 to 5.0.9
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](juliangruber/brace-expansion@v5.0.6...v5.0.9)

Updates `brace-expansion` from 5.0.7 to 5.0.9
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](juliangruber/brace-expansion@v5.0.6...v5.0.9)

Updates `brace-expansion` from 2.1.1 to 2.1.4
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](juliangruber/brace-expansion@v5.0.6...v5.0.9)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 5.0.9
  dependency-type: indirect
- dependency-name: brace-expansion
  dependency-version: 5.0.9
  dependency-type: indirect
- dependency-name: brace-expansion
  dependency-version: 2.1.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [ip-address](https://github.com/beaugunderson/ip-address) from 10.2.0 to 10.5.0.
- [Release notes](https://github.com/beaugunderson/ip-address/releases)
- [Commits](beaugunderson/ip-address@v10.2.0...v10.5.0)

---
updated-dependencies:
- dependency-name: ip-address
  dependency-version: 10.5.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
…abot/npm_and_yarn/ip-address-10.5.0

chore(deps): bump ip-address from 10.2.0 to 10.5.0
Bumps [fast-uri](https://github.com/fastify/fast-uri) from 3.1.2 to 3.1.6.
- [Release notes](https://github.com/fastify/fast-uri/releases)
- [Commits](fastify/fast-uri@v3.1.2...v3.1.6)

---
updated-dependencies:
- dependency-name: fast-uri
  dependency-version: 3.1.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.2.0 to 4.3.1.
- [Changelog](https://github.com/nodeca/js-yaml/blob/4.3.1/CHANGELOG.md)
- [Commits](nodeca/js-yaml@4.2.0...4.3.1)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.3.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
…abot/npm_and_yarn/multi-1ff2894045

chore(deps): bump brace-expansion
…abot/npm_and_yarn/fast-uri-3.1.6

chore(deps): bump fast-uri from 3.1.2 to 3.1.6
…abot/npm_and_yarn/js-yaml-4.3.1

chore(deps-dev): bump js-yaml from 4.2.0 to 4.3.1
GitHub gates on the test merge commit whenever that commit carries a
status, and only falls back to the head when it carries none. The test
merge commit carries none of this repository's other checks, so
reporting there moves the merge gate onto a commit CI never sees, and
that commit is recomputed every time the base branch moves.

Report on head.sha instead. A recomputed test merge commit is no longer
something the evaluator reports on, so drop it from the mid-evaluation
consistency check as well.

14 unit tests pass.
…ontrack-review-policy

ci: enforce OnTrack PR review policy
…english-only-submission-notice

DOC-4: Add English-only submission notice
…nt-composer

refactor: replace ng-flex-layout with Tailwind in task-comment-composer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants