aoijs / aoi.js

aoi.js - The most advanced string-based package to create a Discord Bot fast and powerful.
https://aoi.js.org
Apache License 2.0
332 stars 132 forks source link

Bug: Database corruption bug #552

Closed Mody-0 closed 7 months ago

Mody-0 commented 7 months ago

Bug Type

Function

Bugged Function

The function that creates the issue is unknown

Version of aoi.js

v6.7.0

Version of Node.js

v20.10.0 (LTS)

Excepted Output

No response

Relevant log output

a random closing bracket `}` for some reason is being added into the db out of nowhere and it corrupts the db which results in this error 

7|LnDeep  | SyntaxError: Unexpected non-whitespace character after JSON at position 498303
7|LnDeep  |     at JSON.parse (<anonymous>)
7|LnDeep  |     at JSONParser (/root/Mody/LnDeep/node_modules/@akarui/aoi.db/dist/cjs/utils.js:68:28)
7|LnDeep  |     at Table.fetchFile (/root/Mody/LnDeep/node_modules/@akarui/aoi.db/dist/cjs/KeyValue/src/newtable.js:216:68)
7|LnDeep  |     at async Table.getFirstN (/root/Mody/LnDeep/node_modules/@akarui/aoi.db/dist/cjs/KeyValue/src/newtable.js:625:30)
7|LnDeep  |     at async KeyValue.all (/root/Mody/LnDeep/node_modules/@akarui/aoi.db/dist/cjs/KeyValue/src/database.js:350:16)
7|LnDeep  |     at async Database.all (/root/Mody/LnDeep/node_modules/aoi.js/src/classes/Database.js:63:12)
7|LnDeep  |     at async module.exports [as code] (/root/Mody/LnDeep/node_modules/aoi.js/src/functions/database/userLeaderBoard.js:24:12)
7|LnDeep  |     at async Interpreter (/root/Mody/LnDeep/node_modules/aoi.js/src/core/interpreter.js:333:28)
7|LnDeep  |     at async module.exports (/root/Mody/LnDeep/node_modules/aoi.js/src/handler/NonIntents/interaction.js:68:13)

Code of Conduct

Mody-0 commented 7 months ago

@USERSATOSHI

Leref commented 7 months ago

Report it on the actual repository for further support.

https://github.com/AkaruiDevelopment/aoi.db