Issue
While I was reading through the codebase, I was curious and looked through the code for Autumn.
There's multiple places in the code where there's no check on overflow when people are on their last few credits. This means that when a user's on their last few credits, they could still request a job that uses more credits (like upload a whole textbook) and still only be charged for the remaining credits until their account is drained. You could upload a 1000 page pdf with only 1 credit in your filerouter account and the job would still go through.
Fix
Probably just implement a way to estimate job cost estimates? From the little bit of digging I did I couldn't find anything that does this though so maybe it should be implemented.
Files Affected
billing.server.ts has the main issue, which is that the job check only looks for 1 credit instead of the estimated job processing time. There's probably other ripple files that might be affected with Autumn though.
to reproduce
I didn't actually try it because it would be a lot of credits wasted on nothing but a simple script that infinitely calls the FileRouter API with a simple pdf and then calls the API once more with a larger file once there's only 1 credit left would show that this is an issue.
Issue
While I was reading through the codebase, I was curious and looked through the code for Autumn.
There's multiple places in the code where there's no check on overflow when people are on their last few credits. This means that when a user's on their last few credits, they could still request a job that uses more credits (like upload a whole textbook) and still only be charged for the remaining credits until their account is drained. You could upload a 1000 page pdf with only 1 credit in your filerouter account and the job would still go through.
Fix
Probably just implement a way to estimate job cost estimates? From the little bit of digging I did I couldn't find anything that does this though so maybe it should be implemented.
Files Affected
billing.server.tshas the main issue, which is that the job check only looks for 1 credit instead of the estimated job processing time. There's probably other ripple files that might be affected with Autumn though.to reproduce
I didn't actually try it because it would be a lot of credits wasted on nothing but a simple script that infinitely calls the FileRouter API with a simple pdf and then calls the API once more with a larger file once there's only 1 credit left would show that this is an issue.