Bug: MongoServerError on saving loadouts due to unhandled nested $oid #2684
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
Issue Body :
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.
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
The modified loadout should be successfully saved to the database and persist after a mission.
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)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 }You're wasting a lot of time with AI
Hello User,
Thank you for raising this issue. However, we are unable to reproduce your issue on our local test machine.
Best regards.