* fix(studio): check job_run_details size in cron display
When cron.job_run_details grows too large (200k+ rows), loading the
cron jobs overview can timeout and affect other queries by pulling
excessive data into shared buffers.
This change:
- Estimates table size using pg_stat before fetching cron jobs data
- Shows a cleanup notice when the table exceeds the threshold
- Provides batched deletion using ctid ranges to avoid buffer pollution
- Allows scheduling an automated daily cleanup cron job
- Handles timeout errors gracefully with a "suspected overflow" state
The useCronJobsData hook now returns a discriminated union status that
tracks loading, estimate-error, overflow-confirmed, overflow-suspected,
and ready states, allowing the UI to respond appropriately to each case.
* fix(studio): use index when querying cron.job_run_details
cron.job_run_details is only indexed by runid, not by start_time. Change
the query to use the runid index (which gives the same result, since
runid is auto-incrementing).
* feat: replace usage metric cards with new charts
* feat: use new chart components for auth api and error codes
* style: some tweaks to the two tables
* fix: padding around empty states
* feat: smol adjustment
* fix: add aria label to go to logs tooltip
* fix: diff value
* fix: status code method font colour
* fix: actions onClick
* docs: improve Facebook OAuth guide with troubleshooting and clearer instructions
- Add explicit callback URI pattern with link to dashboard
- Add dedicated "Configure email permissions" section with caution admonition
- Add "Testing your integration" section explaining development mode
- Add "Going live with App Review" section with step-by-step guide
- Add "Troubleshooting" section for common issues
- Add error handling to JavaScript code examples
- Fix Swift example with complete ASWebAuthenticationSession implementation
- Add note about checking pub.dev for latest Flutter package version
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Apply suggestions from code review
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* docs: improve Facebook OAuth guide with troubleshooting and clearer instructions
- Add explicit callback URI pattern with link to dashboard
- Add dedicated "Configure email permissions" section with caution admonition
- Add "Testing your integration" section explaining development mode
- Add "Going live with App Review" section with step-by-step guide
- Add "Troubleshooting" section for common issues
- Add error handling to JavaScript code examples
- Update Swift example to use webAuthenticationSession environment
- Add note about checking pub.dev for latest Flutter package version
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* style: run format
* Apply suggestions from code review
Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
* query perf improvements
* info tooltips
* filter fixes
* prettier wont work in cursor for some reason
* fix type error
* rm clear all filters button, its too much
* prettier
PostHog migration from boolean to string variants is complete.
The helper was only useful during migration - now it's just
`value === 'new-home'` which is trivial to inline.
- Delete apps/studio/lib/featureFlags/ folder
- Inline flag check at 3 call sites
* handling and mock data support
* admonition
* only show in empty state
* rabbit
* mock without local overrides
* remove admonition
* make incident banner more prominent
* remove mock data
* move to tool
* prettier
* fix(studio): get_active_incidents tool
---------
Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
* fix: do not include reports for CLI and self-hosted
* fix: do not display empty product reports
* fix: do not include api gw and custom reports for self-hosted
* fix: ran prettier
* feat: add support for dropping and auto-extracting zip files in Edge Functions editor
* fix: add type assertions for readonly array includes checks in zip extraction
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* feat: add support for PDF and image files in zip extraction
- Moved wasm from ALLOWED_EXTENSIONS to ALLOWED_BINARY_EXTENSIONS
- Added PDF support for document files
- Added common image formats: jpg, jpeg, png, gif, svg, bmp, ico, webp
- Binary files are extracted and preserved but show "Cannot Edit" message in editor
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* refactor: remove file extension validation from zip extraction
Makes zip extraction behavior consistent with regular file drops.
Now all file types are accepted in both cases, matching the
permissive behavior users expect.
Removed:
- ALLOWED_EXTENSIONS and ALLOWED_BINARY_EXTENSIONS arrays
- isAllowedExtension() and isAllowedBinaryFile() validation functions
- getFileExtension() helper (no longer needed)
- Extension-based rejection logic from extractZipFile()
Kept:
- File size validation (individual and total limits)
- Hidden file filtering (.DS_Store, __MACOSX, etc.)
- Binary file detection for proper content reading
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix: correct file replacement detection in addDroppedFiles
Bug: The condition `updatedFiles !== files` always evaluated to true
because updatedFiles is created via files.map() which always returns
a new array reference, even when no files were actually modified.
This caused onFilesChange to be called unnecessarily when dropping
zip files that only contained files with names not matching any
existing files.
Fix: Track whether any existing files were actually replaced using
a hasReplacedFiles flag that is set to true only when we modify
files in the updatedFiles array during zip extraction.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix: add graceful error handling for zip file extraction
Replaced dangerous non-null assertion operator (!) with proper error
handling for entry.getData() calls.
Changes:
- Check entry.directory and entry.getData before extraction
- Wrap getData calls in try-catch to handle extraction failures
- Track failed files and include them in error reporting
- Skip files that can't be extracted instead of crashing
This prevents runtime errors when:
- Zip entries are directories (defensive check)
- Zip entries don't have getData method (corrupted/unusual entries)
- File extraction fails for any reason (encoding issues, etc.)
- Binary/text file reading encounters errors
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* refactor: improve file processing logic with enum and switch statement
Replaced if-else chain with cleaner enum-based approach per PR feedback.
Changes:
- Added FileAction enum (CREATE_NEW, REPLACE_EXISTING, REPLACE_NEW)
- Created getFileAction() helper function that returns action + index
- Refactored file processing loop to use switch statement
- Eliminated duplicate findIndex() calls (was calling it twice)
- Reduced variable count from 2 (existingFileIndex, newFileIndex) to 1 (actionResult)
Benefits:
- More readable and maintainable code
- Single source of truth for file lookup logic
- Better type safety with discriminated union
- Easier to extend with new file actions in the future
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* prettier
* fix: add guard for undefined entry.uncompressedSize in zip extraction
Prevents NaN from bypassing size validation when entry.uncompressedSize
is undefined.
Issue:
- entry.uncompressedSize can be undefined in malformed/corrupted zips
- Without guard: totalExtractedSize + undefined = NaN
- NaN comparisons always return false, bypassing MAX_TOTAL_EXTRACTED_SIZE
- Security risk: allows extraction of files with unknown sizes
Fix:
- Check if uncompressedSize is undefined or NaN before any arithmetic
- Skip files with unknown sizes and add to oversizedFiles array
- Provide descriptive error message: "unknown size - metadata unavailable"
- Ensures size validation always runs safely
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Refactor to streamline handling of regular and zip files in FileExplorerAndEditor
* Address rabbit feedback
* Nit
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>