Skip to content

fix(storage): improve FileObject type accuracy with nullable fields#2116

Open
mandarini wants to merge 2 commits intomasterfrom
fix/storage-types-fileobject
Open

fix(storage): improve FileObject type accuracy with nullable fields#2116
mandarini wants to merge 2 commits intomasterfrom
fix/storage-types-fileobject

Conversation

@mandarini
Copy link
Contributor

  • FileObject: Made id, updated_at, created_at, last_accessed_at, metadata nullable (null for folders)
  • FileObject: Deprecated bucket_id, owner, buckets fields (not returned by list operations)
  • FileObjectV2: Deprecated updated_at field (API returns last_modified)
  • SearchV2Object: Made key optional (sometimes missing in responses)
  • SearchV2Object: Made id, updated_at, created_at, metadata, last_accessed_at nullable (null for folders)
  • Added FileMetadata interface to properly type metadata objects

@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • File objects now use nullable fields and a standardized FileMetadata shape; introduced a richer file-info response (V2) and updated search/list result shapes.
  • Documentation

    • Clarified docs for info/list/listV2/remove with updated response shapes, pagination guidance, and usage examples.
  • Tests

    • Strengthened tests to validate IDs, metadata, and detailed file-info fields in list/remove/info responses.

Walkthrough

The PR introduces a typed FileMetadata interface and applies it across storage types. FileObject fields (id, updated_at, created_at, last_accessed_at, metadata) are now nullable and some legacy fields (bucket_id, owner, buckets) are optional/deprecated. A new FileObjectV2 models Info responses with v2-style fields (etag, size, cache_control, content_type, metadata, version). SearchV2Object was reshaped (name/key, nullable id/updated_at/created_at, FileMetadata), plus a SearchV2Folder alias and nextCursorKey on SearchV2Result. StorageFileApi docs were expanded and tests were updated to assert richer response validation.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the storage-js Related to the storage-js library. label Feb 12, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 12, 2026

Open in StackBlitz

@supabase/auth-js

npm i https://pkg.pr.new/@supabase/auth-js@2116

@supabase/functions-js

npm i https://pkg.pr.new/@supabase/functions-js@2116

@supabase/postgrest-js

npm i https://pkg.pr.new/@supabase/postgrest-js@2116

@supabase/realtime-js

npm i https://pkg.pr.new/@supabase/realtime-js@2116

@supabase/storage-js

npm i https://pkg.pr.new/@supabase/storage-js@2116

@supabase/supabase-js

npm i https://pkg.pr.new/@supabase/supabase-js@2116

commit: 4fa1627

@mandarini mandarini self-assigned this Feb 12, 2026
@mandarini mandarini force-pushed the fix/storage-types-fileobject branch from 130799e to f747aa5 Compare February 12, 2026 13:15
@mandarini mandarini marked this pull request as ready for review February 16, 2026 16:41
@mandarini mandarini requested review from a team as code owners February 16, 2026 16:41
Comment on lines 122 to 123
/** @deprecated Use last_modified instead */
last_accessed_at: string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is shared by info endpoint but it isn't returned so required string would be wrong

@mandarini mandarini force-pushed the fix/storage-types-fileobject branch from 475e161 to 6cee1be Compare February 17, 2026 11:41
@mandarini mandarini force-pushed the fix/storage-types-fileobject branch from 6cee1be to 4fa1627 Compare February 17, 2026 12:53
@coveralls
Copy link

Coverage Status

coverage: 82.869%. remained the same
when pulling 4fa1627 on fix/storage-types-fileobject
into 2fe2b51 on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

storage-js Related to the storage-js library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants