EDCD / EDMarketConnector

Downloads commodity market and other station data from the game Elite: Dangerous for use with all popular online and offline trading tools.
GNU General Public License v2.0
992 stars 155 forks source link

"Update" button doesn't send cargo info to inara #477

Closed awmcclain closed 4 years ago

awmcclain commented 4 years ago

I've noticed that if I hit the "Update" button my cargo list isn't updated on inara -- it seems that cargo is only sent when I first log in to elite.

This makes material trading frustrating because it's difficult to see what I still need after I've made trades.

Repro:

  1. Make material trades
  2. Click 'update'
  3. Inara doesn't show updated cargo list.
  4. Log out of elite
  5. Log back in
  6. Refresh inara -- updated cargo list is there.
A-UNDERSCORE-D commented 4 years ago

Just to clarify here, you're not leaving the station or undocking before you want your cargo updated to inara?

Athanasius commented 4 years ago

FYI, all the 'Update' button is guaranteed to do is a fresh pull of data from the Frontier CAPI service. What plugins, including the core Inara one, then do with that data is down to them.

We're suspecting that you're running into a feature of the EDMC Inara plugin that deliberately limits the amount of API calls it makes to Inara so as to not run afoul of Inara's API rate limit.

From Inara Developers Guide

"Please, do:

I'll need to review the code to be sure, but I believe something like an FSDJump event would cause Inara to get your updated cargo.

awmcclain commented 4 years ago

That’s correct — this is for material trading, so it’s important to be able to see updated amounts while you’re still at the station.

On Wed, Jul 8, 2020 at 1:25 PM A_D notifications@github.com wrote:

Just to clarify here, you're not leaving the station or undocking before you want your cargo updated to inara?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/EDCD/EDMarketConnector/issues/477#issuecomment-655738027, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI3RR2XQDD4YOOJSAFXZDDR2TI4XANCNFSM4KUYQCIQ .

-- Sent from a phone

awmcclain commented 4 years ago

The bigger issue is that updates aren’t sent to INARA when cargo/materials change when you’re trading (because you haven’t left the station). I remember poking around and seeing that the the code suggested that it intended to update (it tracks when cargo/materials change) but there was a logic issue, but that was many months ago.

Is there a better method to report bugs on the INARA plugin?

On Thu, Jul 9, 2020 at 7:12 AM Athanasius notifications@github.com wrote:

FYI, all the 'Update' button is guaranteed to do is a fresh pull of data from the Frontier CAPI service. What plugins, including the core Inara one, then do with that data is down to them.

We're suspecting that you're running into a feature of the EDMC Inara plugin that deliberately limits the amount of API calls it makes to Inara so as to not run afoul of Inara's API rate limit.

From Inara Developers Guide https://inara.cz/inara-api-devguide/

"Please, do:

  • Send events in a batch with a reasonable request rate, for example on session start/end and Docked and/or FSDJump events in the journal. Usually it is not needed to do updates more often than that.
  • Use caching on your side for a stuff that doesn't need to be constantly updated. "

I'll need to review the code to be sure, but I believe something like an FSDJump event would cause Inara to get your updated cargo.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/EDCD/EDMarketConnector/issues/477#issuecomment-656151654, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI3RR52OFPC7XUHERD7YPTR2XF4FANCNFSM4KUYQCIQ .

-- Sent from a phone

Athanasius commented 4 years ago

Is there a better method to report bugs on the INARA plugin?

Despite being a plugin, it's part of the core of EDMC, so you're in the right place.

Athanasius commented 4 years ago

My own cursory reading of the code is that it queues events, and then sends them all in one batch when triggered by major events.

If we change this we risk all Inara users quickly running into the Inara API rate limit, which I believe straight up bans your API Key for up to 24 hours when that happens.

awmcclain commented 4 years ago

What about either 1) only sending updates for material trading while you're in the station or 2) implementing a straight throttle that sends cargo updates every X seconds?

On Thu, Jul 9, 2020 at 7:51 AM Athanasius notifications@github.com wrote:

My own cursory reading of the code is that it queues events, and then sends them all in one batch when triggered by major events.

If we change this we risk all Inara users quickly running into the Inara API rate limit, which I believe straight up bans your API Key for up to 24 hours when that happens.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/EDCD/EDMarketConnector/issues/477#issuecomment-656174834, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI3RRY274BHM2NU37BID43R2XKQ3ANCNFSM4KUYQCIQ .

Athanasius commented 4 years ago

The problem is that Artie (Inara.cz developer) is cagey about exactly what the rate limits are. As I said, the penalty for hitting it is rather harsh, so we can't wait until we do and then back off.

Athanasius commented 4 years ago

I've been in touch with Artie and have a better idea of the proper limits now. We'll look at adjusting the plugin code to better be able to update whilst docked. No ETA.

Athanasius commented 4 years ago

Please try out https://github.com/EDCD/EDMarketConnector/releases/tag/Release%2F3.99.5.0 which includes the changes to the Inara plugin that cause cargo contents to be updated more often. Note the caveats in the changelog!

awmcclain commented 4 years ago

That’s great! It will make keeping track of engineer recipes SO much easier!

On Sat, Jul 11, 2020 at 1:16 PM Athanasius notifications@github.com wrote:

Please try out https://github.com/EDCD/EDMarketConnector/releases/tag/Release%2F3.99.5.0 which includes the changes to the Inara plugin that cause cargo contents to be updated more often. Note the caveats in the changelog!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/EDCD/EDMarketConnector/issues/477#issuecomment-657123019, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI3RR7I3YG22DQPNRSQBPDR3DCA5ANCNFSM4KUYQCIQ .

-- Sent from a phone

Athanasius commented 4 years ago

I'm assuming this is resolved with the 4.0.X.0 releases.