Bug: MongoServerError on saving loadouts due to unhandled nested $oid #2684

Closed
opened 2025-08-22 23:21:24 -07:00 by pkmoze · 4 comments

Issue Body :

  1. Describe the bug
    When a user configures a loadout and enters a mission, the server fails to save the updated loadout to MongoDB upon returning. This results in the user's configuration being reverted.

  2. To Reproduce
    Steps to reproduce the behavior:

Modify any Warframe loadout (e.g., change a weapon).

Start any mission.

Immediately abort or complete the mission.

Return to the Arsenal and observe that the loadout has reverted to its previous

  1. Expected behavior
    The modified loadout should be successfully saved to the database and persist after a mission.
Issue Body : 1. Describe the bug When a user configures a loadout and enters a mission, the server fails to save the updated loadout to MongoDB upon returning. This results in the user's configuration being reverted. 2. To Reproduce Steps to reproduce the behavior: Modify any Warframe loadout (e.g., change a weapon). Start any mission. Immediately abort or complete the mission. Return to the Arsenal and observe that the loadout has reverted to its previous 3. Expected behavior The modified loadout should be successfully saved to the database and persist after a mission.
Author

Hello Developer,

Thank you for your attention to this issue! I noticed a recent commit involving import-services.ts that appears to address this $oid issue. That's great news!

But the issue persists even after I updated my server.
2025-08-23T22:39:49:714 [0.1.0] error: MongoServerError: The dollar ($) prefixed field '$oid' in 'ARCHWING.0.l.ItemId.$oid' is not valid for storage. while processing /api/saveLoadout.php request at UpdateOneOperation.execute (/root/SpaceNinjaServer/node_modules/mongodb/src/operations/update.ts:160:32) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async tryOperation (/root/SpaceNinjaServer/node_modules/mongodb/src/operations/execute_operation.ts:283:14) at async executeOperation (/root/SpaceNinjaServer/node_modules/mongodb/src/operations/execute_operation.ts:115:12) at async Collection.updateOne (/root/SpaceNinjaServer/node_modules/mongodb/src/collection.ts:371:12)

Hello Developer, Thank you for your attention to this issue! I noticed a recent commit involving import-services.ts that appears to address this $oid issue. That's great news! But the issue persists even after I updated my server. `2025-08-23T22:39:49:714 [0.1.0] error: MongoServerError: The dollar ($) prefixed field '$oid' in 'ARCHWING.0.l.ItemId.$oid' is not valid for storage. while processing /api/saveLoadout.php request at UpdateOneOperation.execute (/root/SpaceNinjaServer/node_modules/mongodb/src/operations/update.ts:160:32) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async tryOperation (/root/SpaceNinjaServer/node_modules/mongodb/src/operations/execute_operation.ts:283:14) at async executeOperation (/root/SpaceNinjaServer/node_modules/mongodb/src/operations/execute_operation.ts:115:12) at async Collection.updateOne (/root/SpaceNinjaServer/node_modules/mongodb/src/collection.ts:371:12)`
Author

I've contacted AI, hoping they can help. However, after analyzing import-services.ts, I believe the fix for convertLoadOutConfig may be incomplete.

This function currently converts the top-level itemId to the specified value, but it doesn't seem to handle nested items within the itemId property, such as l (Large), m (Melee), and pg (Pistol). The error log specifically points to these nested fields (e.g., NORMAL.0.l.ItemId.$oid).

The data structure is as follows:
{ "ItemId": { "$oid": "..." }, // This gets converted "l": { "ItemId": { "$oid": "..." } }, // This is being missed "m": { "ItemId": { "$oid": "..." } } // This is also missed }

I've contacted AI, hoping they can help. However, after analyzing import-services.ts, I believe the fix for convertLoadOutConfig may be incomplete. This function currently converts the top-level itemId to the specified value, but it doesn't seem to handle nested items within the itemId property, such as l (Large), m (Melee), and pg (Pistol). The error log specifically points to these nested fields (e.g., NORMAL.0.l.ItemId.$oid). The data structure is as follows: `{ "ItemId": { "$oid": "..." }, // This gets converted "l": { "ItemId": { "$oid": "..." } }, // This is being missed "m": { "ItemId": { "$oid": "..." } } // This is also missed }`
Contributor

You're wasting a lot of time with AI

You're wasting a lot of time with AI
Owner

Hello User,

Thank you for raising this issue. However, we are unable to reproduce your issue on our local test machine.

Best regards.

Hello User, Thank you for raising this issue. However, we are unable to reproduce your issue on our local test machine. Best regards.
Sign in to join this conversation.
No description provided.