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
989 stars 155 forks source link

Unique cargo of the same commodity type is only shown once #817

Closed RemainNA closed 3 years ago

RemainNA commented 3 years ago

Please check the Known Issues in case this has already been reported.

Please also check if the issue is covered in our Troubleshooting Guide. It might be something with a known work around, or where a third party (such as EDSM) is causing logging that is harmless.

It does not appear to be in either

Please complete the following information:

Describe the bug When carrying unique cargo for multiple missions of the same commodity type (i.e. two missions require delivering Food Cartridges) only one of these will be reported.

To Reproduce Steps to reproduce the behavior:

  1. Accept a mission requiring delivering unique cargo, pick up the cargo
  2. Accept a second mission requiring the same type of unique cargo, pick it up too
  3. Only one of these groups of cargo will be reported in EDMC

Expected behavior Both unique cargo are recorded, either in bulk or as separate instances

Screenshots EDMC Bug EDMC Bug Transactions EDMC Bug Inventory

Additional context This was found while using the Cargo Manifest plugin, which I modified to output the cargo dictionary in to the log files. I did restart between noticing the bug and reporting it, but the same behaviour was observed before the restart, and in another case with different missions/cargo.

Athanasius commented 3 years ago

This is a bug in a third-party plugin, not in core EDMC code. Please report it over on the EDMC Cargo Manifest GitHub -> https://github.com/RemainNA/cargo-manifest

Without looking at their code I can only guess that the plugin looks only at the strict "what cargo we have" plus commodity sell/buy events. It could potentially start paying attention to the CargoDepot events as well.

RemainNA commented 3 years ago

Thank you for the suggestion, Cargo Manifest was indeed not checking for CargoDepot events. However I do still think there may be some issues with EDMC core code based on some additional testing and logging I did. Cargo Manifest mostly mirrors state['Cargo'], I checked and that isn't reporting the unique cargo correctly either. I added a little bit of code just to listen to CargoDepot events and when one came through with duplicate unique cargo the state['Cargo'] dictionary changed and only reflected one of the batches of unique cargo.

This is the log directly after picking up the cargo, with Cargo Manifest logging both state['Cargo'] and its internal list this.cargoDict, as well as all CargoDepot events. EDMarketConnector.log

This is the Elite Cargo.json file (converted to txt for Github) taken at the same time to show how it differs from state['Cargo'] Cargo.txt

It looks like when there are multiple instances of cargo with the same name in Cargo.json one overrides the others, instead of their values being added together. Sorry if there's anything I'm not understanding.

Athanasius commented 3 years ago

@RemainNA

Could you please check that https://github.com/EDCD/EDMarketConnector/releases/tag/Release%2F4.1.6-rc1 acts as it should, thanks.

RemainNA commented 3 years ago

It's working when tested with a mission for polymers and non mission polymers in cargo as well. I wasn't able quickly find two missions with the same type of cargo, but this replicates the same conditions.