Coder Social home page Coder Social logo

Comments (11)

cycleguy avatar cycleguy commented on August 13, 2024 2

Thank you in advance @dolcalmi for taking the time to fix this issue.

from medici.

koresar avatar koresar commented on August 13, 2024 1

@dolcalmi @cycleguy any chance you can fix the parseBalanceQuery for us in a PR? That would be awesome and the fastest solution.

from medici.

dolcalmi avatar dolcalmi commented on August 13, 2024 1

@koresar this can be closed once the new version is released

from medici.

Uzlopak avatar Uzlopak commented on August 13, 2024

The implicit registration of Schemas is obsolete with medici v5. you have to write a mongoose schema and use setTransactionSchema use as first parameter the Schema. Based on the Schema, medici v5 determines if it is a meta key or root key. As you did not assigned it, medici tries to search for _businessId and _assetId in the meta field and not on the root field

Also be aware: In medici v4 there was an implicit transformation of all vaues to ObjectIds if the key was starting with an _. Now based on the Schema, we determine if it is an ObjectId or not.

from medici.

cycleguy avatar cycleguy commented on August 13, 2024

We have written a mongoose schema and we are using setTransactionSchema within the mediciTransaction.js file. You mentioned that we did not assign it, what exactly are you referring to? Thanks.

from medici.

Uzlopak avatar Uzlopak commented on August 13, 2024

In your zipfile you don't call setTransactionSchema.

from medici.

cycleguy avatar cycleguy commented on August 13, 2024

I double checked the zip file that I sent you....

  • On line 15 of app.js (if uncommented out) does a require on ./models/mediciTransaction

  • On line 41 of mediciTransaction.js it calls setTransactionSchema()

  • src/app.js

  • src/index.js

  • src/models/mediciTransaction.js

from medici.

dolcalmi avatar dolcalmi commented on August 13, 2024

We have the same issue, I think is a problem in parseBalanceQuery https://github.com/flash-oss/medici/blob/master/src/helper/parse/parseBalanceQuery.ts#L38 should use the same logic used in parseFilterQuery https://github.com/flash-oss/medici/blob/master/src/helper/parse/parseFilterQuery.ts#L52

from medici.

koresar avatar koresar commented on August 13, 2024

The difference exists because the balance query (not the balance, but the query JSON) is being serialised to a single string as a Quick Balance cache key:

export function constructKey(book: string, account?: string, meta?: IAnyObject): string {

The key is being constructed wrongly when schema is not native and you query by our own keys.

Quick workarounds would be to disable Quick Balance feature. Pass balanceSnapshotSec as zero:
new Book(name, { balanceSnapshotSec: 0 });

from medici.

dolcalmi avatar dolcalmi commented on August 13, 2024

this is not the only issue, the problem is how the query is parsed. I will work on it today

from medici.

koresar avatar koresar commented on August 13, 2024

Published in v5.2

from medici.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.