Code Monkey home page Code Monkey logo

Comments (5)

yubozhao avatar yubozhao commented on May 16, 2024 2

@AntonPuko @gaspard
vesper mutation controller has the transaction params to true as default. Make sure you set it to false and test it again.

from vesper.

AntonPuko avatar AntonPuko commented on May 16, 2024 1

@yubozhao yep, it works with transactions disabled for those queries.

from vesper.

pleerock avatar pleerock commented on May 16, 2024

thanks for the PR but its not a fix. I never faced the issue you are describing, can you please elaborate and provide more information, some real reproduction?

from vesper.

anna-bucher avatar anna-bucher commented on May 16, 2024

Here is a demo of the bug in action:

vesper_bug

The first part of this gif shows the original vesper code.
The second part shows with the fix.

As you can see, batch operations fail with current vesper code but work fine with the fix I propose.

If you want to reproduce this, you can close this repo.

Use origin/vesper branch !!

https://github.com/lucidogen/lucidogen

The server is in packages/apps/todomvc-server, the client app is in packages/apps/todomvc.

You need to run npm i && npm run start in each of these directories.

(at the end of the gif, you can see the error reported in the terminal: due to ts-node, the file is wrong but when using tsc and then the JS file, it is effectively from index.js in vesper).

from vesper.

AntonPuko avatar AntonPuko commented on May 16, 2024

@pleerock Hi, I have pretty the same issue, when trying to run many mutations simultaneously.
I get:

TypeError: this.connection.getMetadata is not a function
TypeError: this.connection.getMetadata is not a function
    at EntityManager.<anonymous> (D:\PROG\gm-intelligence\chatbot.gql-server\src\entity-manager\EntityManager.ts:575:42)
    at step (D:\PROG\gm-intelligence\chatbot.gql-server\node_modules\typeorm\entity-manager\EntityManager.js:32:23)
    at Object.next (D:\PROG\gm-intelligence\chatbot.gql-server\node_modules\typeorm\entity-manager\EntityManager.js:13:53)
    at D:\PROG\gm-intelligence\chatbot.gql-server\node_modules\typeorm\entity-manager\EntityManager.js:7:71
    at Promise (<anonymous>)
    at __awaiter (D:\PROG\gm-intelligence\chatbot.gql-server\node_modules\typeorm\entity-manager\EntityManager.js:3:12)
    at EntityManager.findOne (D:\PROG\gm-intelligence\chatbot.gql-server\node_modules\typeorm\entity-manager\EntityManager.js:431:16)
    at EntityManager.<anonymous> (D:\PROG\gm-intelligence\chatbot.gql-server\src\entity-manager\EntityManager.ts:620:21)
    at step (D:\PROG\gm-intelligence\chatbot.gql-server\node_modules\typeorm\entity-manager\EntityManager.js:32:23)
    at Object.next (D:\PROG\gm-intelligence\chatbot.gql-server\node_modules\typeorm\entity-manager\EntityManager.js:13:53)
    at EntityManager.<anonymous> (D:\PROG\gm-intelligence\chatbot.gql-server\src\entity-manager\EntityManager.ts:575:42)
TypeError: Cannot read property 'type' of undefined
    at D:\PROG\gm-intelligence\chatbot.gql-server\src\index.ts:141:60
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at step (D:\PROG\gm-intelligence\chatbot.gql-server\node_modules\typeorm\entity-manager\EntityManager.js:32:23)
    at Object.next (D:\PROG\gm-intelligence\chatbot.gql-server\node_modules\typeorm\entity-manager\EntityManager.js:13:53)
    at D:\PROG\gm-intelligence\chatbot.gql-server\node_modules\typeorm\entity-manager\EntityManager.js:7:71
    at Promise (<anonymous>)
    at __awaiter (D:\PROG\gm-intelligence\chatbot.gql-server\node_modules\typeorm\entity-manager\EntityManager.js:3:12)
    at EntityManager.findOne (D:\PROG\gm-intelligence\chatbot.gql-server\node_modules\typeorm\entity-manager\EntityManager.js:431:16)
    at EntityManager.<anonymous> (D:\PROG\gm-intelligence\chatbot.gql-server\src\entity-manager\EntityManager.ts:620:21)
    at step (D:\PROG\gm-intelligence\chatbot.gql-server\node_modules\typeorm\entity-manager\EntityManager.js:32:23)
    at Object.next (D:\PROG\gm-intelligence\chatbot.gql-server\node_modules\typeorm\entity-manager\EntityManager.js:13:53)

on random of those requests. @gaspard fix doesn't really help since I just get another undefined errors.
It looks like container from typeDI doesn't inject all deps properly in time of those requests..or something like that.

My tsconfig.json config:

  "compilerOptions": {
    "allowJs": true,
    "baseUrl": ".",
    "experimentalDecorators": true,
    "forceConsistentCasingInFileNames": true,
    "jsx": "react",
    "lib": ["es6", "esnext", "dom"],
    "module": "esnext",
    "moduleResolution": "node",
    "outDir": "build/dist",
    "rootDir": "src",
    "sourceMap": true,
    "target": "es5"
  },

I'm on windows 10, using postgress for DB and folllowing deps versions:

    "pg": "^7.4.3",
    "typeorm": "^0.2.7",
    "typescript": "^2.9.2",
    "vesper": "^0.1.9"

Let me know if you need some more info or anything.

from vesper.

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.