Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data conflict problem #242

Closed
dadiorchen opened this issue Jun 14, 2021 · 3 comments · May be fixed by #233
Closed

Data conflict problem #242

dadiorchen opened this issue Jun 14, 2021 · 3 comments · May be fixed by #233
Labels
question Further information is requested

Comments

@dadiorchen
Copy link
Collaborator

dadiorchen commented Jun 14, 2021

The problem is, after an update request/endpoint, seems like if we create a new DB connection to fetch the data, we have a probability to get stale data, NOTE it is not for sure the data is stale, just sometimes it happens, like 50% probability. If we WAIT for a while, the data is correct.

https://github.com/dadiorchen/treetracker-token-trading-api/blob/1b00682cd294d0e9ad0e44dce73c33a81b8e48c1/__tests__/integration/impact-value-transfer.spec.js#L47-L63

@dadiorchen
Copy link
Collaborator Author

dadiorchen commented Jun 14, 2021

  await request(server)
    .post(`/transfers/${transferId}/accept`)
    .set('Content-Type', "application/json")
    .set('treetracker-api-key', registeredMeisze.apiKey)
    .set('Authorization', `Bearer ${registeredMeisze.token}`)
    .expect(200)
    .then(res => {
      expect(res).property("body").property("impact_value_transferred").eq(4);
    });


  // TODO bug!
  await new Promise(r => setTimeout(() => r(), 500));
  // Meisze should have one token
  const token = await testUtils.getTokenById(TokenA.id);
  expect(token).property("id").a("string");
  expect(token).property("wallet_id").eq(registeredMeisze.id);
  expect(token).property("claim").eq(false);

@dadiorchen dadiorchen linked a pull request Jun 14, 2021 that will close this issue
@Kpoke Kpoke added the question Further information is requested label Jul 3, 2023
@Kpoke Kpoke closed this as completed Jul 3, 2023
@sebastiangaertner
Copy link
Contributor

@Kpoke is this sorted out?

@Kpoke
Copy link
Collaborator

Kpoke commented Jul 3, 2023

@dadiorchen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants