## Context
Just a nit change to float the status code from status page API into
incident-status endpoint so its clearer what the error is from the
network tab
---------
Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
`/incident-status` and `/incident-banner` are not cached because they
include auth cookies which busts Vercel cache. This PR add `credentials:
omit` since they calls don't need auth cookies and they're same for all
users.
The incident queries have been hammering statuspage and incident.io API
endpoints which has resulted in 429 and 75% of all requests failing.
This PR sets the retry on fail to 4s, 16s, 64s, 256s and 300s.
Previously it was set to 2s, 4s, 8s, 16s and 32s.
Feature
## What is the current behavior?
Incident banner logic depends on StatusPage and Supabase project for
metadata.
## What is the new behavior?
New incident banner logic that depends only on incident.io. Displays in
non-production environments for now because I haven't wired up the rest
of the workflow. This is just to allow a total end-to-end
testing/playground for test incidents <-> Slack <-> preview dashboard
for people to try out the UX.
## Additional context
You can test using my [test
incident](https://app.incident.io/supabase/incidents/405). This has
severity minor, so the preview site should have a banner. Toggle to
informative, hard refresh dashboard with cache off, and banner should
disappear. Toggle back to minor, hard refresh without cache again, and
banner should reappear. Same thing if you edit the "Banner shown" field
from 1 to -1 and back.
## Context
PR mainly adds a change to allow users to dismiss an incident banner
Am also taking this time to consolidate `IncidentBanner` and
`MaintenanceBanner` into a single component `StatusPageBanner` so that
the logic for rendering either component is more clearer.
## Intended behaviour (should be covered by e2e tests)
- Incident banner shows if there are incidents with impact !== 'none'
- Incident banner still takes precedence over Maintanence banner (if
there's both incident + maintenence events)
- Dismissing the incident banner will subsequently show the maintenance
banner if the maintenance hasn't been dismissed before (just to make
sure that the user doesn't miss any comms)
- Incident banner will not be dismissible if there's an override (via
feature flag or env var)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Unified status page banner showing incident or maintenance
notifications, with dismissible banners that persist across sessions;
incident notices take precedence over maintenance.
* **Refactor**
* Replaced separate incident and maintenance banners with a single
consolidated StatusPageBanner component.
* **Tests**
* Added end-to-end tests covering banner visibility, precedence, and
dismissal behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
* Update support form status page button to use incident query + make maintenance banner dismissible
* Clean up
* Nit
* Attempt to fix tests
* Fix tests
* callout
* progress
* plural issues
* better handle multiple issues
* refactor
* remove fancy copywriting
* return IncidentAdmonition to support form page
* progress
* cleanup
* rabbit
Potential control flow issue: execution continues after handleError when data is undefined. When a non-401 error occurs, handleError(error) is called but execution continues to line 24 where data is accessed. If handleError doesn't throw, this will cause a runtime error accessing (data as any).is_healthy on undefined. Additionally, the as any cast on line 24 violates the coding guidelines. Consider validating the response shape instead.
* animate in
* fix
* reset
* remove unused dayjs
* rabbit
* rabbit
* fixes from code review
* rabbit
* rabbit
---------
Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
* Add custom types for queries, mutations and infinite queries.
* Migrate all queries to use the new type.
* Migrate all infinite queries to useCustomInfiniteQueryOptions.
* Migrate all mutations to use useCustomMutationOptions.
* Add type to all imports in `types` folder.
* First round of wrapping RQ errors with handleError
* Remove the throw before the handleError usage.
* Make the handling of an API error more versatile. Add logging in Sentry if the error is of unknown type.
* Remove throwing of the handleError function.
* Add return type to the handleError function to be never so that we're sure it always throws.
* Second round of wrapping RQ errors with handleError
* Temp fix in delete credential mutation, and fix loading state
---------
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
* 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.