fix: QRデータ生成の統一とFirestoreセキュリティルール修正#145
Conversation
There was a problem hiding this comment.
Pull Request Overview
QRコードデータの生成処理を統一し、Firestoreセキュリティルールを修正してサブコレクションへのアクセス権限を適切に設定するPRです。
- QRコード生成処理を統一されたURL形式(
https://animeishi-viewer.web.app/user/{uid})に修正 - Firestoreセキュリティルールでサブコレクションの読み取り権限を追加
- 名刺画像の詳細表示機能を新規追加
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
lib/ui/home/view/meishi_detail_page.dart |
名刺画像の拡大表示ページを新規作成 |
lib/ui/home/view/home_page.dart |
QRデータ生成処理の統一と名刺詳細ページへの遷移機能を追加 |
lib/ui/home/constants/meishi_constants.dart |
名刺画像の正確なアスペクト比定数を追加・修正 |
firestore.rules |
ユーザーサブコレクションの読み取り権限を拡張 |
| return decodedPath; | ||
| } | ||
| } catch (e) { | ||
| print('Storage パス抽出エラー: $e'); |
There was a problem hiding this comment.
print文を使用したログ出力は本番環境では推奨されません。適切なログライブラリ(loggerパッケージなど)を使用するか、Flutter標準のdebugPrintを使用することを推奨します。
| print('Storage パス抽出エラー: $e'); | |
| debugPrint('Storage パス抽出エラー: $e'); |
| borderRadius: BorderRadius.circular(MeishiConstants.borderRadius), | ||
| boxShadow: [ | ||
| BoxShadow( | ||
| color: Colors.black.withValues(alpha: 0.1), |
There was a problem hiding this comment.
withValues(alpha: 0.1)の使用方法を確認してください。通常はwithOpacity(0.1)を使用します。withValuesが正しいAPIかどうか検証が必要です。
| color: Colors.black.withValues(alpha: 0.1), | |
| color: Colors.black.withOpacity(0.1), |
| allow read: if subcollection == "selectedAnime"; | ||
| allow read: if subcollection == "selectedAnime" || | ||
| subcollection == "favorites" || | ||
| subcollection == "meishies" || |
There was a problem hiding this comment.
セキュリティルールでsubcollection == "meishies"の読み取り権限を全ユーザーに許可していますが、これによりプライベートな名刺データが他のユーザーからも読み取り可能になります。isOwner(userId)条件のみに制限することを検討してください。
| subcollection == "meishies" || | |
| subcollection == "favorites" || |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…meishi into KOU050223/add-meishi-image
|
Visit the preview URL for this PR (updated for commit e047ac0): https://animeishi-73560--pr145-kou050223-add-meishi-0zlybmmj.web.app (expires Sat, 23 Aug 2025 16:05:53 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: f1f494a67df8ccbb2232f73b6ccab4934a51e505 |
Summary
変更内容
QRデータ生成の統一
home_page.dart内で複数箇所で異なる形式のqrDataが生成されていた問題を修正https://animeishi-viewer.web.app/user/{uid}を使用するように変更Firestoreセキュリティルール修正
firestore.rulesでユーザーのサブコレクション(selectedAnime, favorites, meishies)への読み取り権限を追加Test plan