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

EDMC is not syncing Inara ranks and rank progress when (re)logging while on foot. #1378

Closed
mIRCon opened this issue Dec 18, 2021 · 9 comments
Assignees
Labels
Milestone

Comments

@mIRCon
Copy link

mIRCon commented Dec 18, 2021

Please complete the following information:

  • Version: 5.3.0-beta2
  • Game Version: Odyssey
  • OS: Windows 10
  • OS Locale: English
  • If applicable: Browser N/A

Describe the bug
EDMC is not syncing Inara ranks and rank progress when (re)logging while on foot.
In order to have ranks updated on Inara you have to enter the ship and then relog the game.
It doesn't matter how many times you relog on foot consecutively, ranks and rank progress won't be synced until you enter the ship and relog the game.

To Reproduce
Steps to reproduce the behavior:

  1. Enter the game and do some bounties on foot or exobiology or any other activity which affects ranks and rank progress %.
  2. After handing in those activities while still on foot just relog the game.
  3. If you use --trace-on plugin.inara.events you will see that no ranks and rank progression is being sent to Inara.
  4. Check Inara CMDR page for rank and rank progress change just to see that none has been updated.
  5. Enter the ship and relog the game.
  6. If you use --trace-on plugin.inara.events you will see that ranks and rank progression are sent to Inara.
  7. Check Inara CMDR page for rank and rank progress change just to see that it's now updated properly.

Expected behavior
Since journal contains ranks and rank progress values whenever you (re)log the game no matter whether you're on foot or in the ship EDMC should use those values when syncing with Inara.

Screenshots
N/A

Additional context
I have included EDMarketConnector-debug.log since last night during testing with --trace-on plugin.inara.events and cleared fdevid, apikey and other "personal" data (other than cmdr name that is) along with two journal events when relogging the game while on foot and while in the ship so you can compare those events and see why EDMC is triggering Inara rank and rank progression sync while in the ship and not while on foot relog.
Maybe it would be good to check whether other things are not being synced as well when relogging on foot but are provided with journal entries too. (just as precaution while you're investigating this issue anyway)
EDMarketConnector-debug.log
Journal on foot relog events.txt
Journal in ship relog events.txt

@mIRCon mIRCon added bug unconfirmed An unconfirmed bug labels Dec 18, 2021
@Athanasius
Copy link
Contributor

This is due to the code around line 425 of plugins/inara.py, which aims to not send any Inara API events for things like rank progress until a ship Cargo event is seen. There's no such event when logging in on foot, so the code never triggers to send the data.

The proper fix is to review this whole state tracking and delayed sending. It shouldn't be necessary any more with the strict queue and 35s timer between Inara API calls. Worst case scenario we'll send a single 'startup'-related event immediately and then the rest 35s later.

@Athanasius Athanasius removed the unconfirmed An unconfirmed bug label Dec 19, 2021
@Athanasius Athanasius added this to the 5.3.0 milestone Jan 20, 2022
@Athanasius Athanasius self-assigned this Jan 20, 2022
@Athanasius
Copy link
Contributor

@Athanasius Athanasius reopened this Feb 5, 2022
@Athanasius
Copy link
Contributor

@mIRCon ping! Did you get chance to test this specific issue/fix yet ?

@mIRCon
Copy link
Author

mIRCon commented Feb 7, 2022

@Athanasius the situation is even worse. It does sync when you relog on foot but it sends 0% for EVERY rank's rank progress.

From the journal:
{ "timestamp":"2022-02-07T23:13:46Z", "event":"Rank", "Combat":7, "Trade":8, "Explore":8, "Soldier":9, "Exobiologist":0, "Empire":14, "Federation":14, "CQC":0 }
{ "timestamp":"2022-02-07T23:13:46Z", "event":"Progress", "Combat":31, "Trade":1, "Explore":13, "Soldier":18, "Exobiologist":0, "Empire":100, "Federation":100, "CQC":0 }
{ "timestamp":"2022-02-07T23:13:46Z", "event":"Reputation", "Empire":68.699997, "Federation":98.146004, "Alliance":71.778000 }

From EDMC log with Inara trace turned on:
"events": [{"eventName": "setCommanderRankPilot", "eventTimestamp": "2022-02-07T23:13:46Z", "eventData": [{"rankName": "combat", "rankValue": 7, "rankProgress": 0.0}, {"rankName": "trade", "rankValue": 8, "rankProgress": 0.0}, {"rankName": "explore", "rankValue": 8, "rankProgress": 0.0}, {"rankName": "soldier", "rankValue": 9, "rankProgress": 0.0}, {"rankName": "exobiologist", "rankValue": 0, "rankProgress": 0.0}, {"rankName": "empire", "rankValue": 14, "rankProgress": 0.0}, {"rankName": "federation", "rankValue": 14, "rankProgress": 0.0}, {"rankName": "cqc", "rankValue": 0, "rankProgress": 0.0}]},

The final result is that all of my ranks on Inara have rank progress of 0% instead of their actual values.

@Athanasius
Copy link
Contributor

Aha! Looks like a simple enough bug.

  1. At login Rank is written, and then another event Progress, in that order.
  2. We do store both values per rank in monitor.py
  3. BUT The Inara plugin triggers off the Rank event for sending the data. At this point the Progress event hasn't yet been processed, so all those values are still zero!

Now I just need to consider if there's any merit to making the code paranoid about the order of these two events. The latest Journal document makes no guarantee about this.

@Athanasius
Copy link
Contributor

OK, checks out with the change in #1445 - I both debugged it going through the Inara plugin code for (now) Progress and confirmed I see the correct progress on my Inara profile when mouse-overing the ranks.

Stay tuned for -beta9.

@Athanasius
Copy link
Contributor

@Athanasius
Copy link
Contributor

@Athanasius
Copy link
Contributor

So, seems to be working in -beta10, closing this. Will re-open if there are fresh reports using 5.3.0-beta10 or later.

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

No branches or pull requests

2 participants