Skip to content

feat: 코드리뷰 반영#48

Merged
dasosann merged 1 commit intomainfrom
feat/firebase
Mar 27, 2026
Merged

feat: 코드리뷰 반영#48
dasosann merged 1 commit intomainfrom
feat/firebase

Conversation

@dasosann
Copy link
Copy Markdown
Contributor

No description provided.

@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Firebase 버전 업그레이드 및 에러 처리 개선

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Firebase 메시징 라이브러리 버전 업그레이드 (9.23.0 → 12.8.0)
• 토큰 재발급 실패 시 alert 제거
Diagram
flowchart LR
  A["Firebase 라이브러리 버전"] -->|"9.23.0 → 12.8.0"| B["firebase-messaging-sw.js 업데이트"]
  C["토큰 재발급 실패"] -->|"alert 제거"| D["redirect만 실행"]
Loading

Grey Divider

File Changes

1. lib/server-api.ts ✨ Enhancement +0/-1

토큰 재발급 실패 시 alert 제거

• 토큰 재발급 실패 시 alert 메시지 제거
• redirect("/login")만 실행하도록 정리

lib/server-api.ts


2. public/firebase-messaging-sw.js Dependencies +2/-2

Firebase 라이브러리 버전 업그레이드

• Firebase 라이브러리 버전을 9.23.0에서 12.8.0으로 업그레이드
• firebase-app-compat.js 버전 업데이트
• firebase-messaging-compat.js 버전 업데이트

public/firebase-messaging-sw.js


Grey Divider

Qodo Logo


✨ Describe tool usage guide:

Overview:
The describe tool scans the PR code changes, and generates a description for the PR - title, type, summary, walkthrough and labels. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.

When commenting, to edit configurations related to the describe tool (pr_description section), use the following template:

/describe --pr_description.some_config1=... --pr_description.some_config2=...

With a configuration file, use the following template:

[pr_description]
some_config1=...
some_config2=...
Enabling\disabling automation
  • When you first install the app, the default mode for the describe tool is:
pr_commands = ["/describe", ...]

meaning the describe tool will run automatically on every PR.

  • Markers are an alternative way to control the generated description, to give maximal control to the user. If you set:
pr_commands = ["/describe --pr_description.use_description_markers=true", ...]

the tool will replace every marker of the form pr_agent:marker_name in the PR description with the relevant content, where marker_name is one of the following:

  • type: the PR type.
  • summary: the PR summary.
  • walkthrough: the PR walkthrough.
  • diagram: the PR sequence diagram (if enabled).

Note that when markers are enabled, if the original PR description does not contain any markers, the tool will not alter the description at all.

Custom labels

The default labels of the describe tool are quite generic: [Bug fix, Tests, Enhancement, Documentation, Other].

If you specify custom labels in the repo's labels page or via configuration file, you can get tailored labels for your use cases.
Examples for custom labels:

  • Main topic:performance - pr_agent:The main topic of this PR is performance
  • New endpoint - pr_agent:A new endpoint was added in this PR
  • SQL query - pr_agent:A new SQL query was added in this PR
  • Dockerfile changes - pr_agent:The PR contains changes in the Dockerfile
  • ...

The list above is eclectic, and aims to give an idea of different possibilities. Define custom labels that are relevant for your repo and use cases.
Note that Labels are not mutually exclusive, so you can add multiple label categories.
Make sure to provide proper title, and a detailed and well-phrased description for each label, so the tool will know when to suggest it.

Inline File Walkthrough 💎

For enhanced user experience, the describe tool can add file summaries directly to the "Files changed" tab in the PR page.
This will enable you to quickly understand the changes in each file, while reviewing the code changes (diffs).

To enable inline file summary, set pr_description.inline_file_summary in the configuration file, possible values are:

  • 'table': File changes walkthrough table will be displayed on the top of the "Files changed" tab, in addition to the "Conversation" tab.
  • true: A collapsable file comment with changes title and a changes summary for each file in the PR.
  • false (default): File changes walkthrough will be added only to the "Conversation" tab.
Utilizing extra instructions

The describe tool can be configured with extra instructions, to guide the model to a feedback tailored to the needs of your project.

Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Notice that the general structure of the description is fixed, and cannot be changed. Extra instructions can change the content or style of each sub-section of the PR description.

Examples for extra instructions:

[pr_description]
extra_instructions="""- The PR title should be in the format: '<PR type>: <title>'
- The title should be short and concise (up to 10 words)
- ...
"""

Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable.

More PR-Agent commands

To invoke the PR-Agent, add a comment using one of the following commands:

  • /review: Request a review of your Pull Request.
  • /describe: Update the PR title and description based on the contents of the PR.
  • /improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
  • /ask <QUESTION>: Ask a question about the PR.
  • /update_changelog: Update the changelog based on the PR's contents.
  • /help_docs <QUESTION>: Given a path to documentation (either for this repository or for a given one), ask a question.
  • /add_docs 💎: Generate docstring for new components introduced in the PR.
  • /generate_labels 💎: Generate labels for the PR based on the PR's contents.
  • /analyze 💎: Automatically analyzes the PR, and presents changes walkthrough for each component.

See the tools guide for more details.
To list the possible configuration parameters, add a /config comment.

See the describe usage page for a comprehensive guide on using this tool.

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review bot commented Mar 27, 2026

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 📐 Spec deviations (0)

Grey Divider


Remediation recommended

1. Firebase version drift risk 🐞 Bug ⚙ Maintainability
Description
public/firebase-messaging-sw.js hardcodes Firebase CDN URLs to a specific version, but the app
imports Firebase from the npm dependency declared as a semver range (firebase: ^12.8.0). A future
dependency bump can leave the service worker running a different SDK version than the app, making
FCM issues difficult to reproduce and debug.
Code

public/firebase-messaging-sw.js[R3-8]

importScripts(
-  "https://www.gstatic.com/firebasejs/9.23.0/firebase-app-compat.js",
+  "https://www.gstatic.com/firebasejs/12.8.0/firebase-app-compat.js",
);
importScripts(
-  "https://www.gstatic.com/firebasejs/9.23.0/firebase-messaging-compat.js",
+  "https://www.gstatic.com/firebasejs/12.8.0/firebase-messaging-compat.js",
);
Evidence
The service worker loads Firebase from version-pinned CDN URLs, while the application code uses the
Firebase npm package and the dependency is declared with a caret range, meaning it may update
without any change to the service worker file—creating an easy-to-miss version coupling point.

public/firebase-messaging-sw.js[3-8]
package.json[15-30]
lib/firebase.ts[1-6]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`public/firebase-messaging-sw.js` pins Firebase CDN versions directly in code, but the app uses the Firebase npm package declared as `^12.8.0`. This can drift over time and create mismatched SDK versions between the app and service worker.

### Issue Context
- Service worker uses `importScripts("https://www.gstatic.com/firebasejs/<ver>/...")`.
- App code imports Firebase via npm (`firebase/app`, `firebase/messaging`).

### Fix Focus Areas
- Add an automated sync mechanism so the SW CDN version stays aligned with the installed `firebase` npm version (or self-host the SW Firebase scripts).
- file/path references:
 - public/firebase-messaging-sw.js[3-8]
 - package.json[15-30]
 - lib/firebase.ts[1-6]

### Suggested implementation options
1) **Build-time rewrite**: add a small script (run in `postinstall` or `build`) that reads `node_modules/firebase/package.json` version and rewrites the URLs in `public/firebase-messaging-sw.js`.
2) **Self-host**: copy the required compat bundles into `public/` during build and `importScripts("/local-path.js")` to avoid CDN version pinning entirely.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이번 풀 리퀘스트에서는 세션 만료 시 사용자 알림(alert)을 제거하고 즉시 로그인 페이지로 이동하도록 수정하였으며, Firebase SDK 버전을 12.8.0으로 업데이트했습니다. 리뷰어는 서비스 워커 내에서 반복되는 Firebase SDK 버전 정보를 상수로 관리하여 package.json과의 동기화 및 유지보수 효율성을 높일 것을 제안했습니다.

Comment on lines 3 to 8
importScripts(
"https://www.gstatic.com/firebasejs/9.23.0/firebase-app-compat.js",
"https://www.gstatic.com/firebasejs/12.8.0/firebase-app-compat.js",
);
importScripts(
"https://www.gstatic.com/firebasejs/9.23.0/firebase-messaging-compat.js",
"https://www.gstatic.com/firebasejs/12.8.0/firebase-messaging-compat.js",
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

서비스 워커에서 importScripts를 통해 로드하는 Firebase SDK 버전은 package.json에 명시된 버전과 일치해야 합니다. 현재 버전 정보가 여러 곳에 하드코딩되어 있어 관리 효율성이 떨어지고 버전 불일치 위험이 있으므로, 상수를 도입하여 일관성을 유지하고 package.json의 버전과 동기화할 것을 권장합니다.

Suggested change
importScripts(
"https://www.gstatic.com/firebasejs/9.23.0/firebase-app-compat.js",
"https://www.gstatic.com/firebasejs/12.8.0/firebase-app-compat.js",
);
importScripts(
"https://www.gstatic.com/firebasejs/9.23.0/firebase-messaging-compat.js",
"https://www.gstatic.com/firebasejs/12.8.0/firebase-messaging-compat.js",
);
const FIREBASE_VERSION = "12.8.0";
importScripts(
"https://www.gstatic.com/firebasejs/" + FIREBASE_VERSION + "/firebase-app-compat.js"
);
importScripts(
"https://www.gstatic.com/firebasejs/" + FIREBASE_VERSION + "/firebase-messaging-compat.js"
);
References
  1. Ensure that Firebase SDK versions loaded via importScripts in a service worker match the version specified in package.json to prevent compatibility issues.

@dasosann dasosann merged commit 0446ad4 into main Mar 27, 2026
2 checks passed
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