-
Notifications
You must be signed in to change notification settings - Fork 135
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
Remove on_xhr_error
from type system
#1193
Comments
the code was removed here #898 |
👋 |
hey @joernroeder we tend to avoid breaking changes as much as possible... since folk loading posthog with the snippet will get the latest version if they are providing But, it should be that we're safely ignoring it... is it breaking things for you? Or only confusing that it's present? |
You guys broke the functionality by keeping the types but removing the implementation which left us (and others potentially) in the dark. The callback didn't get called anymore when it should have. For us that was bad, last time you guys had an outage our "on error" logic didn't trigger, causing ripple effects which we prevented by relying on the on error callback in the first place. Worst part, no way for us to realize that the handler got removed. Semver, did not indicate breaking changes, not the types. deprecating it, adding console warning, while keeping the functionality alive, plus appropriate semver bump would have been the right move imo. We now have playwright tests which test for outages and correct behavior but sadly had to learn the hard way. Edit: we don't load the snipped but use the client provided by the npm package. |
Ah, fair... that's a pain and we should have realised and avoided it... i can only say sorry 💖 |
wait... i can do more than apologise... we can at least warn the future traveller #1298 (sorry again, we try to be super careful with the SDKs but we didn't manage it here 😞 ) (we have to keep it in the type system since it'll break folk in a different way to remove it, so I'll close this but hopefully not taken as dismissive of the impact this had on you) |
you could add a @deprecated jsdoc comment on the typescript prop, many editors pick that up and show it struck through which would give devs a hint. |
Ah... we've hit similar here at PostHog too with the difference between // comments and /** */ comments between pycharm and vscode... I use jetbrains IDEs which tend to be much better at picking things up so |
After sleeping on this I think the best move would have been to do something like this dummy code below:
{
/**
* @deprecated use `on_request_error` instead.
*/
on_xhr_error: (args) => {
console.warn('on_xhr_error is deprecated, use on_request_error instead')
return this.on_request_error(args) // use .bind, .call etc here but you get the idea
}
} |
Totally agree :) i think it'd be closing the stable door after the horse has bolted now but this absolutely 100% should not have been breaking for anyone - like i say we try to be super careful on this and we didn't manage it with this change |
The configuration key
on_xhr_error
is marked as deprecated but looking at the code on closer inspection, calls to it have been removed and the callback is no longer being called, breaking functionality.The text was updated successfully, but these errors were encountered: