Skip to content

fix: QRデータ生成の統一とFirestoreセキュリティルール修正#145

Merged
KOU050223 merged 7 commits intodevelopfrom
KOU050223/add-meishi-image
Aug 16, 2025
Merged

fix: QRデータ生成の統一とFirestoreセキュリティルール修正#145
KOU050223 merged 7 commits intodevelopfrom
KOU050223/add-meishi-image

Conversation

@KOU050223
Copy link
Owner

@KOU050223 KOU050223 commented Aug 16, 2025

Summary

  • QRデータ生成処理を統一された形式に修正
  • Firestoreセキュリティルールでサブコレクションの読み取り権限を追加

変更内容

QRデータ生成の統一

  • home_page.dart内で複数箇所で異なる形式のqrDataが生成されていた問題を修正
  • 全ての箇所で統一されたURL形式 https://animeishi-viewer.web.app/user/{uid} を使用するように変更

Firestoreセキュリティルール修正

  • firestore.rulesでユーザーのサブコレクション(selectedAnime, favorites, meishies)への読み取り権限を追加
  • プロフィール画面での統計データ取得時の権限エラーを解決

Test plan

  • QRコード生成が正常に動作することを確認
  • プロフィール画面で統計データが正常に取得できることを確認
  • Firestoreセキュリティルールが適切に動作することを確認

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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');
Copy link

Copilot AI Aug 16, 2025

Choose a reason for hiding this comment

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

print文を使用したログ出力は本番環境では推奨されません。適切なログライブラリ(loggerパッケージなど)を使用するか、Flutter標準のdebugPrintを使用することを推奨します。

Suggested change
print('Storage パス抽出エラー: $e');
debugPrint('Storage パス抽出エラー: $e');

Copilot uses AI. Check for mistakes.
borderRadius: BorderRadius.circular(MeishiConstants.borderRadius),
boxShadow: [
BoxShadow(
color: Colors.black.withValues(alpha: 0.1),
Copy link

Copilot AI Aug 16, 2025

Choose a reason for hiding this comment

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

withValues(alpha: 0.1)の使用方法を確認してください。通常はwithOpacity(0.1)を使用します。withValuesが正しいAPIかどうか検証が必要です。

Suggested change
color: Colors.black.withValues(alpha: 0.1),
color: Colors.black.withOpacity(0.1),

Copilot uses AI. Check for mistakes.
allow read: if subcollection == "selectedAnime";
allow read: if subcollection == "selectedAnime" ||
subcollection == "favorites" ||
subcollection == "meishies" ||
Copy link

Copilot AI Aug 16, 2025

Choose a reason for hiding this comment

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

セキュリティルールでsubcollection == "meishies"の読み取り権限を全ユーザーに許可していますが、これによりプライベートな名刺データが他のユーザーからも読み取り可能になります。isOwner(userId)条件のみに制限することを検討してください。

Suggested change
subcollection == "meishies" ||
subcollection == "favorites" ||

Copilot uses AI. Check for mistakes.
@KOU050223 KOU050223 moved this to レビュー待ち in アニ名刺Project Aug 16, 2025
@KOU050223 KOU050223 self-assigned this Aug 16, 2025
KOU050223 and others added 3 commits August 17, 2025 00:45
@github-actions
Copy link

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

@KOU050223 KOU050223 merged commit e851c60 into develop Aug 16, 2025
2 of 3 checks passed
@github-project-automation github-project-automation bot moved this from レビュー待ち to Done in アニ名刺Project Aug 16, 2025
@KOU050223 KOU050223 deleted the KOU050223/add-meishi-image branch August 16, 2025 16:07
@KOU050223 KOU050223 moved this from Done to レビュー待ち in アニ名刺Project Aug 16, 2025
@KOU050223 KOU050223 moved this from レビュー待ち to Done in アニ名刺Project Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

2 participants