Qbox-project / qbx_vehicles

provides API to manage player owned vehicles
GNU General Public License v3.0
1 stars 10 forks source link

Inserting a vehicle doesn't check for duplicates #4

Open solareon opened 7 months ago

solareon commented 7 months ago

Summary

Inserting a vehicle doesn't check for duplicate plates

Reproduction

Insert a vehicle with the same plate as an existing vehicle

Expected behavior

Return an error to the calling resource

Actual behavior

SQL error and potentially hang resource depending on how the export was called.

Additional context

https://github.com/Qbox-project/qbx_vehicles/blob/0198d9dee99f3cf0ff174a3572724426598f4e44/server/main.lua#L35-L45

This should return success or failure and the optional error that occurred allowing the resource to retry

Current Version

latest commit

Custom Resources

n/a

ArturMichalak commented 4 months ago

Plates should be generated in a sql procedure or in a transaction.