Commit Graph
9 Commits
Author SHA1 Message Date
Jordi Enric 5b8f504ce3 fix(studio): preserve restore times across date edits FE-4129 (#51613)
## Problem

Changing the restore date resets the entered time, and the repeated hour
at the end of daylight saving time can resolve to the wrong occurrence.
Both can change the submitted recovery timestamp.

## Fix

Store the recovery point as a Unix timestamp and preserve its occurrence
when editing an ambiguous local time. Calendar edits carry the entered
hours, minutes, and seconds onto the selected day, applying that day's
timezone offset and retaining the existing backup-range clamping.

This focuses on date edits and repeated-hour handling from #48903. It
changes only the PITR form, its utilities, and regression tests. Related
to
[FE-4129](https://linear.app/supabase/issue/FE-4129/r2np-datetime-widget).

## How to test

- In PITR or restore-to-new-project, enter a time and select another
available calendar day. Expected result: the entered hours, minutes, and
seconds remain selected, and the submitted timestamp matches the new
date.
- Run the PITRForm and PITR.utils Vitest suites. Their fixtures cover
both occurrences of the repeated Madrid/New York hour, edits across DST,
spring-forward normalization, fractional offsets, and backup boundaries.
- Twelve focused regression cases passed under a Madrid browser
timezone. Those cases plus the existing selector component test passed
under Hong Kong, thirteen tests total. All CI checks passed, including
Studio tests, all four Next.js/TanStack E2E shards, typecheck, lint
ratchet, formatting, spelling, unused-code checks, and Docker build.
2026-10-16 16:20:25 +02:00
Jordi EnricandJoshen Lim d1e0b551c5 fix(studio): show correct timezone offsets FE-4612 (#51484)
## Problem

Restore timezone labels use fixed UTC offsets from the timezone catalog.
Madrid displays UTC+01:00 during daylight saving time even though the
reported restore timestamp correctly uses UTC+02:00.

## Fix

Calculate display offsets from the restore instant and the timezone's
IANA identifier using Intl. Apply the same formatter to dropdown
options, the selected timezone, and PITR confirmation while preserving
existing restore calculations and timezone selection identity.

Fixes https://linear.app/supabase/issue/FE-4612

## How to test

- Choose Madrid in restore-to-new-project or PITR and compare winter and
summer restore dates. Expected result: UTC+01:00 in winter and UTC+02:00
during daylight saving time, including the confirmation label.
- Check UTC, New York, Kolkata, and Kathmandu. Expected result: correct
zero, negative, and fractional offsets.
- Focused Vitest suite: 15 tests passed, including both Madrid DST
boundaries and timestamp preservation. The component test verifies
visible trigger and option labels update after a date change, Madrid
search results, selection preserving the original timezone object, and
popover closure. It also passes under UTC and Hong Kong browser
timezones. Prettier and diff checks passed.
- All CI checks passed for the latest commit, including Studio tests,
all four Next.js/TanStack E2E shards, typecheck, lint ratchet,
formatting, spelling, unused-code checks, and Docker build. Full local
typecheck and ESLint validation were blocked by the shared dependency
installation being out of sync with this checkout.

Calculation audit confirmed the reported October 9 Madrid 05:12 to UTC
03:12 conversion. Separate existing date-control issues were found when
browser and restore timezones differ and around the repeated autumn
hour; those are outside this label fix and relevant to FE-4129.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-10-12 14:36:48 +08:00
4a0bb36ca8 style: require sorted imports in studio/components (#44408)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2026-04-01 10:22:37 +02:00
Ali WaseemandIvan Vasilov 8a26132bde fix(studio): resolve outstanding Sentry issues (#44106)
## Summary

Fixes several high-impact Sentry errors reported in production.

### Fixed Issues

- **[SUPABASE-APP-EJ3](https://supabase.sentry.io/issues/7356937474/)**
— `TypeError: Cannot read properties of undefined (reading 'direct')`.
`connectionStringPooler` could be `undefined` when the connection source
doesn't match any key in the connection strings map. Added an early
return guard in `resolveConnectionString`.

- **[SUPABASE-APP-B17](https://supabase.sentry.io/issues/7117468199/)**
— `RangeError: Invalid time zone specified: Etc/Unknown`.
`dayjs.tz.guess()` returns `"Etc/Unknown"` for some users with
misconfigured browser/OS timezones. Added a shared
`guessLocalTimezone()` helper that validates the guessed timezone via
`Intl.DateTimeFormat` and falls back to UTC. Applied across all 4 call
sites.

- **[SUPABASE-APP-BCM](https://supabase.sentry.io/issues/7192934901/)**
— `TypeError: Cannot convert undefined or null to object`.
`Object.entries(definition.properties)` crashed when a JSON schema
definition existed but had no `properties` field. Updated the guard to
check `definition?.properties` instead of just `definition`.
- https://supabase.sentry.io/issues/7357780302/?project=5459134
- https://supabase.sentry.io/issues/7358344652/?project=5459134
- https://supabase.sentry.io/issues/7096737077/?project=5459134

## Test plan

- [ ] Verify connect dialog renders without errors when connection data
is still loading
- [ ] Verify API docs Entity view handles schema definitions without
properties
- [ ] Verify charts/tooltips display correct timezone labels

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2026-03-23 21:20:47 +00:00
Kamil Ogórek c3a352331a ref: Fix all API types after Zod migration (#34903) 2025-04-11 10:28:08 +08:00
Kevin Grüneberg f9a55935f5 chore: use type imports for types/interfaces (#21738) 2024-03-04 20:48:22 +08:00
1fb755bfc7 chore: use data/fetchers and API spec (#20196)
* chore: use data/fetchers and API spec

* Remove unused imports

---------

Co-authored-by: Thomas Eckl <31189692+ecktoteckto@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-01-08 14:39:32 +08:00
Kevin Grüneberg d12332ea5a chore: xmas cleanup (#19938) 2024-01-04 17:27:49 +01:00
Ivan Vasilov 436bdb10ae chore: Move the studio app to apps/studio (#18915)
* Move all studio files from /studio to /apps/studio.

* Move studio specific prettier ignores.

* Fix the ui references from studio.

* Fix the css imports.

* Fix all package.json issues.

* Fix the prettier setup for the studio app.

* Add .turbo folder to prettierignore.

* Fix the github workflows.
2023-11-15 12:38:55 +01:00