-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't write API deprecations to a file #245
Comments
^ This |
Same problem here. I don't understand why write a file in /vendor folder. 🤯 |
Is there any workaround for this besides forking the library? This causes a fatal crash and means I can't fetch orders using |
Answering my own question with a workaround I found:
You may need to run |
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days. |
This comment was marked as outdated.
This comment was marked as outdated.
+1 |
+1 |
8 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
Same issue since Oct 02. All the payments stopped working, so I had to comment out code in the library (file |
+1 |
From what I can tell, this was fixed in #263 (3ae0ed4) by moving the temporary file into @paulomarg, I think this issue can be closed now. |
It's up to the maintainers of course, but in all honesty I still don't get why a library has to write deprecations to a file. Even though it's just to the temp directory, there's still a file somewhere that can potentially grow to unknown sizes and can't be routed elsewhere. |
The file contains only a unix timestamp. |
… which then makes me wonder why we need it at all, or at least from a userland perspective. It's now turning into a discussion of principles and I know that I am on the annoying end of the spectrum, but the cleaner and less surprises in code (especially code provided by a company such as Shopify), the better :) |
It seems like an option to disable this is required, perhaps when doing Context::initialize. The file |
+1 |
1 similar comment
+1 |
The existence of this is so absolutely mind bogglingly absurd. We have a zoom call of 8 people trying to figure out how to get past this right now, it took us 3 days to figure out what was even happening. Because WHY, IN THE NAME OF ALL THE CHILDREN IN THE WORLD, would anyone do something so completely asinine as writing to If you don't understand why this is not a reasonable thing to do, I have a pamphlet for a high flying career in food service right here for you to peruse. |
+1 |
+1 |
This fixes Shopify#245 by no longer writing a timestamp to the filesystem.
It appears that if an API deprecation occurs, the SDK attempts to write this deprecation to a file named
.last_api_deprecation_warning
. This happens in theHttp
class and does not seem to be configurable behavior.In our case, we (as most container-based environments) prevent write access to an application's directories except for a few selected ones, and
/vendor
definitely isn't one of them for obvious reasons. Thefile_put_contents
call unfortunately doesn't have any error handling so a deprecation is now causing exceptions that then trigger our monitoring.Would it be possible to remove this logic? If I'm being totally honest I don't see the need to write anything directly to a file; that's what libraries such as Monolog or another PSR-compliant library are meant for.
The text was updated successfully, but these errors were encountered: