invernyx / smartcars-3-phpvms5-api

The API responsible for connecting smartCARS to phpVMS 5
MIT License
7 stars 7 forks source link

[BUG] - Changing your pilotId removes access to pilot's data #69

Closed Thien42 closed 1 year ago

Thien42 commented 1 year ago

Describe the bug

The SC3 API uses the user's pilot_id field to link the different tables (pireps, sessions, bids, etc ...). However phpvms uses the user_id field to link the different tables. If your user_id and pilot_id are not the same value, the data will look fine in SC3, but not when using the phpvms UI or vice-versa.

I would also expect to be able to change my pilot_id whenever I want and keep the behaviour consistant between phpvms7 and SC3, since this is something the phpvms7 UI offers.

How do you reproduce this bug?

  1. Have a different value for pilot_id and user_id for a given pilot in the users table.
  2. Fly a flight and submit a pirep it using SC3
  3. The pirep will be available in the user's logbook in SC3, but not in the phpvms UI

Expected behavior

The usage of ids to link the various tables should be consistant between the SC3 API and phpvms.

Screenshots

No response

API Version

0.3.3

PHP Version

8

Database & version

Mysql

Webserver version

Apache 2

Browser

Any

Handler

phpvms7

Additional context

No response

Thien42 commented 1 year ago

Fixed in 0.3.4