Stop using auto-incremented IDs in transfer requests
Currently, when making a transfer request, the gateway uses the internal, auto-incremented ID as transfer ID. This is a problem as it might lead to ID collision when the gateway resets its increment. Instead of using the ID, the gateway should use the RemoteTransferID
when making a request (like it already does on the server-side). This RemoteTransferID
should be initialized when the transfer is created, and its value should be somewhat random (like a UUID).
How this ID is generated is still up for debate, but there are some limitations. On the database side, RemoteTransferID
is stored as VARCHAR(100), so there aren't really any limitations there. Same for HTTP, since headers don't have a maximum length. SFTP does not allow sending transfer IDs in the request, so the problem does not apply there. However, in the R66 protocol, transfer IDs must have the int64 type.
This means that, whatever method we chose to generate the IDs, these IDs cannot be longer than 64 bits when represented as integers.