feat: Quests 2 #878
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "Quests2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Walkthrough
This pull request introduces several interconnected changes across multiple files in the project. The modifications primarily focus on updating the key chain and quest-related functionality. A new dependency version for
warframe-public-export-plusis updated in thepackage.json. The changes include introducing a new controller for handling key chain triggered messages, modifying the inventory and quest services, and updating interfaces related to messages and key chain requests.The modifications streamline the handling of key chain items, quest stages, and message processing. A new
giveKeyChainTriggeredMessageControllerhas been added to the API routes, and the existing services have been refactored to support more flexible item and message handling. The changes also include improvements to error messaging and data structure organization.Suggested reviewers
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
❤️ Share
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
I pushed a fix in commit <commit_id>, please review it.Generate unit testing code for this file.Open a follow-up GitHub issue for this discussion.@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.@coderabbitai modularize this function.@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and generate unit testing code.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR. (Beta)@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.Other keywords and placeholders
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed.@coderabbitai summaryto generate the high-level summary at a specific location in the PR description.@coderabbitaianywhere in the PR title to generate the title automatically.Documentation and Community
Actionable comments posted: 8
🧹 Nitpick comments (3)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between
01d369bf38and58ea23a0f8.⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json📒 Files selected for processing (10)
package.json(1 hunks)src/controllers/api/giveKeyChainTriggeredItemsController.ts(2 hunks)src/controllers/api/giveKeyChainTriggeredMessageController.ts(1 hunks)src/controllers/api/updateQuestController.ts(2 hunks)src/models/inboxModel.ts(1 hunks)src/models/inventoryModels/inventoryModel.ts(1 hunks)src/routes/api.ts(2 hunks)src/services/inventoryService.ts(4 hunks)src/services/itemDataService.ts(5 hunks)src/services/questService.ts(2 hunks)🧰 Additional context used
🪛 GitHub Check: build (22)
src/controllers/api/updateQuestController.ts
[failure] 7-7:
'addItem' is defined but never used
[failure] 7-7:
'combineInventoryChanges' is defined but never used
src/services/questService.ts
[failure] 53-53:
'questStage' is never reassigned. Use 'const' instead
src/services/itemDataService.ts
[failure] 36-36:
'IMessageDatabase' is defined but never used
🪛 GitHub Check: build (20)
src/controllers/api/updateQuestController.ts
[failure] 7-7:
'addItem' is defined but never used
[failure] 7-7:
'combineInventoryChanges' is defined but never used
src/services/questService.ts
[failure] 53-53:
'questStage' is never reassigned. Use 'const' instead
src/services/itemDataService.ts
[failure] 36-36:
'IMessageDatabase' is defined but never used
🪛 GitHub Check: build (18)
src/controllers/api/updateQuestController.ts
[failure] 7-7:
'addItem' is defined but never used
[failure] 7-7:
'combineInventoryChanges' is defined but never used
src/services/questService.ts
[failure] 53-53:
'questStage' is never reassigned. Use 'const' instead
src/services/itemDataService.ts
[failure] 36-36:
'IMessageDatabase' is defined but never used
🪛 ESLint
src/controllers/api/updateQuestController.ts
[error] 7-7: 'addItem' is defined but never used.
(@typescript-eslint/no-unused-vars)
[error] 7-7: 'combineInventoryChanges' is defined but never used.
(@typescript-eslint/no-unused-vars)
src/services/questService.ts
[error] 53-53: 'questStage' is never reassigned. Use 'const' instead.
(prefer-const)
src/services/itemDataService.ts
[error] 36-36: 'IMessageDatabase' is defined but never used.
(@typescript-eslint/no-unused-vars)
🪛 GitHub Actions: Build
src/controllers/api/updateQuestController.ts
[error] 7-7: 'addItem' is defined but never used
🔇 Additional comments (7)
⚠️ Potential issue
Add validation for keyChainInfo properties.
The keyChainInfo object should be validated before use to ensure required properties exist.
📝 Committable suggestion
@ -0,0 +11,4 @@const accountId = await getAccountIdForRequest(req);const keyChainInfo = JSON.parse((req.body as Buffer).toString()) as IKeyChainRequest;console.log(keyChainInfo);⚠️ Potential issue
Add error handling for JSON parsing.
The JSON parsing of the request body should be wrapped in a try-catch block to handle malformed JSON gracefully.
📝 Committable suggestion
@ -0,0 +31,4 @@const inventory = await getInventory(accountId, "QuestKeys");updateQuestStage(inventory, keyChainInfo, { m: true });await inventory.save();⚠️ Potential issue
Add error handling for database operations.
The database operations should be wrapped in a try-catch block to handle potential failures gracefully.
📝 Committable suggestion
@ -6,3 +6,3 @@import { getQuestCompletionItems } from "@/src/services/itemDataService";import { addItem, combineInventoryChanges, getInventory } from "@/src/services/inventoryService";import { addItem, addItems, combineInventoryChanges, getInventory } from "@/src/services/inventoryService";⚠️ Potential issue
Remove unused imports.
The imports
addItemandcombineInventoryChangesare no longer used in the code. This is causing build failures.Apply this diff to fix the build:
📝 Committable suggestion
🧰 Tools
🪛 GitHub Check: build (22)
[failure] 7-7:
'addItem' is defined but never used
[failure] 7-7:
'combineInventoryChanges' is defined but never used
🪛 GitHub Check: build (20)
[failure] 7-7:
'addItem' is defined but never used
[failure] 7-7:
'combineInventoryChanges' is defined but never used
🪛 GitHub Check: build (18)
[failure] 7-7:
'addItem' is defined but never used
[failure] 7-7:
'combineInventoryChanges' is defined but never used
🪛 ESLint
[error] 7-7: 'addItem' is defined but never used.
(@typescript-eslint/no-unused-vars)
[error] 7-7: 'combineInventoryChanges' is defined but never used.
(@typescript-eslint/no-unused-vars)
🪛 GitHub Actions: Build
[error] 7-7: 'addItem' is defined but never used
⚠️ Potential issue
Remove duplicate item addition.
The
addKeyChainItemsfunction is adding items twice:addItemaddItemscallApply this diff to remove the duplicate operation:
⚠️ Potential issue
Remove unused import.
The
IMessageDatabaseimport is not used in this file.Apply this diff to remove the unused import:
🧰 Tools
🪛 GitHub Check: build (22)
[failure] 36-36:
'IMessageDatabase' is defined but never used
🪛 GitHub Check: build (20)
[failure] 36-36:
'IMessageDatabase' is defined but never used
🪛 GitHub Check: build (18)
[failure] 36-36:
'IMessageDatabase' is defined but never used
🪛 ESLint
[error] 36-36: 'IMessageDatabase' is defined but never used.
(@typescript-eslint/no-unused-vars)
⚠️ Potential issue
Use const for questStage variable.
The variable is never reassigned, so it should use const instead of let.
📝 Committable suggestion
🧰 Tools
🪛 GitHub Check: build (22)
[failure] 53-53:
'questStage' is never reassigned. Use 'const' instead
🪛 GitHub Check: build (20)
[failure] 53-53:
'questStage' is never reassigned. Use 'const' instead
🪛 GitHub Check: build (18)
[failure] 53-53:
'questStage' is never reassigned. Use 'const' instead
🪛 ESLint
[error] 53-53: 'questStage' is never reassigned. Use 'const' instead.
(prefer-const)
🛠️ Refactor suggestion
Add input validation and improve error messages.
The function should validate input parameters and provide more descriptive error messages.
📝 Committable suggestion
🧰 Tools
🪛 GitHub Check: build (22)
[failure] 53-53:
'questStage' is never reassigned. Use 'const' instead
🪛 GitHub Check: build (20)
[failure] 53-53:
'questStage' is never reassigned. Use 'const' instead
🪛 GitHub Check: build (18)
[failure] 53-53:
'questStage' is never reassigned. Use 'const' instead
🪛 ESLint
[error] 53-53: 'questStage' is never reassigned. Use 'const' instead.
(prefer-const)
1ba870da3ftoef9dab75f9