lenra-io / server

GNU Affero General Public License v3.0
6 stars 0 forks source link

[Bug]: @me not replaced in transactions #495

Closed taorepoara closed 5 months ago

taorepoara commented 8 months ago

What happened?

I tried to create and query database documents using the @me but it's set as null instead of the user id.

To reproduce the problem replace this function (https://github.com/lenra-io/template-bun-ts/blob/1123885f2283fbf98beaf38ff40180c0eca5c682/src/listeners/systemEvents.ts#L29) by the next one:

async function createCounter(api: Api, user: string) {
    const transaction = await api.data.startTransaction();
    const counterColl = transaction.coll(Counter);
    let counters = await counterColl.find({ user });
    console.log(counters);
    if (counters.length == 0) {
        await counterColl.createDoc(new Counter(user, 0));
        return transaction.commit();
    }
    return transaction.abort();
}

What browsers are you seeing the problem on?

No response

Version

lenra/devtools latest 7790ca183815

Relevant log output

No response

taorepoara commented 5 months ago

:tada: This issue has been resolved in version 1.5.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: