Skip to content

Refactor: Standardize Firebase Storage bucket names and upload paths#202

Merged
kumarpalsinh25 merged 1 commit intomainfrom
kumar/minor-changes
Dec 23, 2025
Merged

Refactor: Standardize Firebase Storage bucket names and upload paths#202
kumarpalsinh25 merged 1 commit intomainfrom
kumar/minor-changes

Conversation

@kumarpalsinh25
Copy link
Collaborator

@kumarpalsinh25 kumarpalsinh25 commented Dec 23, 2025

This commit refactors the Firebase Storage implementation to use a more standardized and hierarchical structure.

Key changes include:

  • A new subFolderName parameter has been added to the uploadFileToStorage utility function to allow for more organized file paths within buckets.
  • The userId parameter has been removed from uploadFileToStorage, making the function more generic. The user ID can now be passed as a subFolderName.
  • Storage bucket names in FirestoreBucketNames have been consolidated. userAvatars is now simply users, and new constants for sheets, sheetBanners, and documents have been added for future use.
  • The user avatar upload logic in user_providers.dart has been updated to use the new users bucket and pass the user ID as a subFolderName.

Summary by CodeRabbit

  • Refactor
    • Reorganized file storage structure with improved bucket configuration for better asset management
    • Updated storage paths to support flexible sub-folder organization
    • Adjusted user data storage to align with new bucket structure

✏️ Tip: You can customize this high-level summary in your review settings.

This commit refactors the Firebase Storage implementation to use a more standardized and hierarchical structure.

Key changes include:
- A new `subFolderName` parameter has been added to the `uploadFileToStorage` utility function to allow for more organized file paths within buckets.
- The `userId` parameter has been removed from `uploadFileToStorage`, making the function more generic. The user ID can now be passed as a `subFolderName`.
- Storage bucket names in `FirestoreBucketNames` have been consolidated. `userAvatars` is now simply `users`, and new constants for `sheets`, `sheetBanners`, and `documents` have been added for future use.
- The user avatar upload logic in `user_providers.dart` has been updated to use the new `users` bucket and pass the user ID as a `subFolderName`.
@kumarpalsinh25 kumarpalsinh25 marked this pull request as ready for review December 23, 2025 10:56
@coderabbitai
Copy link

coderabbitai bot commented Dec 23, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This change refactors Firebase storage path management by removing the userId parameter from the uploadFileToStorage function and introducing an optional subFolderName parameter. Firestore bucket constants are reorganized, replacing userAvatars with more granular categories (users, sheets, sheetBanners, documents). The user avatar upload provider is updated to use the new bucket structure.

Changes

Cohort / File(s) Summary
Firebase Upload Utility
lib/common/utils/firebase_utils.dart
Function signature updated: removed required userId parameter, added optional subFolderName parameter. Storage path construction changed from bucketName/userId/fileName to conditionally include subFolderName between bucket and file name.
Storage Bucket Constants
lib/core/constants/firestore_constants.dart
Reorganized FirestoreBucketNames: removed userAvatars, added users, sheets, sheetBanners, documents constants. Shifts from per-asset-type buckets to per-entity-type organization.
User Avatar Provider
lib/features/users/providers/user_providers.dart
Updated updateUserAvatar to use new FirestoreBucketNames.users bucket and invoke uploadFileToStorage without the userId parameter.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kumar/minor-changes

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d5dd2bc and e31bc7a.

📒 Files selected for processing (3)
  • lib/common/utils/firebase_utils.dart
  • lib/core/constants/firestore_constants.dart
  • lib/features/users/providers/user_providers.dart

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@kumarpalsinh25 kumarpalsinh25 merged commit f0deaa5 into main Dec 23, 2025
6 of 9 checks passed
@kumarpalsinh25 kumarpalsinh25 deleted the kumar/minor-changes branch December 23, 2025 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant