Skip to content

FIX photoPickerController#171

Closed
sasatank wants to merge 2 commits intodevfrom
fix/photo-picker
Closed

FIX photoPickerController#171
sasatank wants to merge 2 commits intodevfrom
fix/photo-picker

Conversation

@sasatank
Copy link
Copy Markdown
Collaborator

@sasatank sasatank commented Mar 23, 2025

関連のタスク issue

対応したこと

  • APIにpushするphotoIdをphoto.pathからphoto.idに変更

未解決事項

  • なし

実際の挙動

チェックリスト

  • 実装完了後、問題が起こっていないか実際に動作確認したか
  • 補足があった方が良い/重点的にレビューが欲しい箇所にGitHub上でコメントをしたか

その他コメント

feat: 位置情報取得時のデバッグログにuserIdとphotoIdを追加
@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Logging Improvement

The added logging statements for location retrieval are helpful, but ensure they do not expose sensitive user information unnecessarily. Review the logging level and content.

  logger.d('位置情報を取得しました: userId=$userId, photoId=$modifiedPhotoId, 緯度=$latitude, 経度=$longitude');
  await ref.read(photoRepositoryProvider).registerStoreInfo(
        photoId: modifiedPhotoId,
        userId: userId,
        latitude: latitude,
        longitude: longitude,
      );
} else {
  logger.w('位置情報の取得に失敗しました: userId=$userId, photoId=$modifiedPhotoId');
Error Handling

The new code for handling photo file retrieval and location extraction lacks detailed error handling. Consider adding more robust error handling to manage potential failures.

  final photoFile = await photo.file;
  if (photoFile == null) {
    logger.e('写真ファイルの取得に失敗しました');
    return;
  }

await ref.read(localPhotoRepositoryProvider).savePhoto(
          photo: photo,
          isFood: true,
);

  final location = await _getImageLocation(photoFile.path);
  logger.d('位置情報: $location');

  if (location != null && location.isNotEmpty) {
    // サーバーに位置情報を送信
    await ref.read(photoRepositoryProvider).registerStoreInfo(
          photoId: modifiedPhotoId,
          userId: userId,
          latitude: location['latitude'],
          longitude: location['longitude'],
        );
Background Task Execution

The background task execution for photo classification has been simplified, but ensure that potential exceptions during the process are properly caught and logged.

final selectedPhotos = 
    selectedLocalPhotos.toList();
final photoListNotifier = ref.read(
  classifyLocalPhotoNotifierProvider.notifier,
);

final tasks = selectedPhotos.map((photo) async {
  await photoListNotifier.classifyPhotoAsFood(
    photo: photo,
  );
}).toList();

unawaited(Future.wait(tasks));

@schwarzwald0906
Copy link
Copy Markdown
Collaborator

こちら放置されたままになってるので、クローズしますね!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants