mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 11:22:04 +00:00
Local storage is an untyped interface external to the frontend code itself. The `data` field after `JSON.parse`'d from `raw_data` can be further validated using `zod`'s schema `formDataSchema`. The test case `server_upgrade_alert hide_duration_expired` in `navbar_alerts.test.js` has a bug at `start_time`, which is fixed in this commit. `start_time` is a mock value of `Date.now()` used in `localstorage.ts`, which will concatenate with a number `expires`. So `start_time` was supposed to be an integer value. Before fix, `new Date(1620327447050)` returns a `Date` object which is wrongly concatenated with `expires`. Fixes #24997.
4.7 KiB
4.7 KiB