Giter VIP home page Giter VIP logo

Comments (5)

riQQ avatar riQQ commented on May 27, 2024

In the latest version, if you click on the account name in the top right, do you get to choose between multiple accounts/ IDs?

from mtgatool-desktop.

azkore avatar azkore commented on May 27, 2024

Yes, in both 6.2.13 and 6.3.8, I see multiple accounts. As far as I understand, the problem concerns the total number of matches across all accounts. This number can be viewed when hovering over the icon in the bottom left edge. In 6.2.13, it shows 1451 matches, whereas in 6.3.8, it's only 64. Those 64 are for a secondary account I don't really use, the matches there are all older than a month. The history for all the other accounts is just empty with the new version.

from mtgatool-desktop.

azkore avatar azkore commented on May 27, 2024

A question: is there a way to edit the database using some cli tool? I could try to understand the db structure and update the fields to match the new version expectations manually.

from mtgatool-desktop.

Manwe-777 avatar Manwe-777 commented on May 27, 2024

Since 2.6.13 I moved all db and connection related layers to a web worker, before that it was as simple as accessing the toolDb object within the window, but now thats one layer down in the web worker, which is currently still in development (im still moving pieces of the db to the worker), you can see how the db works here;
https://github.com/manwe-777/mtgatool-db

Unfortunately there is no CLI for the db yet, however I can guide you trough the db , since its all just javascript it should be quite straightforward once you have mtgatool running (either from source code or the app, or even on the browser)

The user data is under the "userids" key, that returns your MTG arena user ids with a timestamp and mtgatool infers the latest one as the default. from there you can follow the methods used in afterLogin.ts to have an idea of the keys and functions used to gather all users match data. I recommend you triying this in 6.2.13 running from source code to get an idea first, there its just as easy as using window.toolDb on the browser or console with Alt + Shift + D, on the web workers version all of that is hidden from console access.

Also please hit me up on Discord if you want ! im interested seeing what happened here since the latest version should show your user data properly.

from mtgatool-desktop.

Manwe-777 avatar Manwe-777 commented on May 27, 2024

As per discussed on Discord, this issue was actually because the local db on the web worker could not see the old indexeddb outside the web worker, thus the data that was not synchronized with the server was simply missing and could not be synchronized again.

We managed to solve it connecting v6.2.13 to the server via commands and force pushing the match data to the server using a loop like this;

// connect to server 
window.toolDb.network.connectTo({"host":"api.mtgatool.com","ssl":true,"name":"mtgatool-default-server","pubKey":"ccdde0f639db3ccb18ed2d48ed405323eac3ce86762923c1010796433e9a392dec3771400f524d4f0a466c0701cad99bbd8b509df3a467c8ca76fab7dc5504bb","signature":"b39f2b4e41605b8629fb583ff519162d12a45eb10c4aa10a42867624ba2ab18f4a2ed43884eefd95a17f48846385fe404d54fa731ea6d47d6ee8aecfefc3873a"})

// send all local matches data
const keys=await self.toolDb.queryKeys(`:${self.toolDb.user.pubKey}.matches-`)
for (key of keys) { 
    let match=key.split('.')[1];
    console.log(match);
    const data=await self.toolDb.getData(key)
    await window.toolDb.putData(match, data, true);
}

im closing this issue because its solved but I wanted to give some insight on how we solved it in case it comes back for someone else.

from mtgatool-desktop.

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.