Commit Graph

64 Commits

Author SHA1 Message Date
Dean Herbert 23e297d414 Log output response sizes
Visibility is the first step towards action. Or something.
2021-11-30 19:09:13 +09:00
Dean Herbert 0ecf5f201c Rename `User` to `APIUser` and move to correct namespace 2021-11-07 11:26:01 +09:00
Dean Herbert 51e92e1b2d Check for null/empty instead 2021-11-03 04:09:31 +09:00
Dean Herbert 8d0b32981f Fix unauthenticated API requests no longer working 2021-11-03 03:30:15 +09:00
Dean Herbert b41fa41c85 Rename `APIRequest.Result` to `Response` 2021-10-05 14:28:56 +09:00
Dean Herbert a6b7ca1a4c Ensure all request failures are correctly handled during login 2021-08-19 19:55:14 +09:00
Dean Herbert 3a5324c947 Fix aborting an `APIRequest` potentially resulting in incorrect success 2021-07-29 13:01:52 +09:00
Dean Herbert 1ed4fdd5f5 Avoid deserialisation JSON request content when error is not present (or not relevant) 2021-07-28 20:13:40 +09:00
Dean Herbert 57e5f5575a Fix derived API request types firing success when they shouldn't
The usual case of `virtual`/`override` being dangerous when logic is
added to the base implementation. As such, I've removed this completely.
2021-07-22 14:23:27 +09:00
Dean Herbert 80c2b1449b Fix API request potentially firing failed events after completion
Specifically, `Cancel()` calls were not thread safe. Due to a series of
events, `ListPollingComponent` could call `Cancel` from a non-update
thread, leading to a race condition where both a `Success` and `Fail`
event can be fired.

This is intended to be the simplest fix possible, locking and guarding
specifically on the callbacks. Further work could be done in the future
to improve the flow surrounding `pendingFailure`, potentially reducing
redundant work and cleaning up the code, but that's not happening here.

Closes https://github.com/ppy/osu/issues/13632.
2021-07-19 20:27:01 +09:00
Dean Herbert ce452565f4 Avoid firing any kind of failures after success 2021-03-23 17:50:31 +09:00
Dean Herbert f5ba746ae5 Fail all API requests sent to DummyAPIAccess
Until now, API requests sent to dummy API were just lost in the void. In most cases this somehow worked as expected, but any logic which is waiting on a request to finish will potentially never get a response.

Going forward, I'm not 100% sure that every `Wait` on a web response will have local timeout logic (I think there is a certain amount of assumption that this is being managed for us by `APIAccess`), so I've made this change to better handle such cases going forward. Now, rather than nothing happening, requests will trigger a failure via the existing exception logic rather than silently pretending the request never arrived.
2021-03-23 17:37:45 +09:00
Dean Herbert 323da82477 Add website root URL and update most links to use it
For what it's worth, I intentionally didn't include news / changelog /
supporter, because these should never change.
2020-12-24 18:11:42 +09:00
smoogipoo 8e8a11bb72 Add APIRequest.TriggerFailure() for testing 2020-07-31 20:55:26 +09:00
Dean Herbert 7fe69bb199 Fix some web requests retrieving the user too early 2020-07-14 13:07:17 +09:00
alex 0e2ccac33b Add spaces to comments 2020-05-04 18:36:24 -07:00
Dean Herbert 801f02a3d7 Fix inline executions of APIRequest.Perform not getting result populated early enough 2020-04-20 17:48:02 +09:00
Dean Herbert 1c8a71b284 Exception instead of assert 2020-04-13 21:24:47 +09:00
Dean Herbert c96df97586 Add support for non-generic requests 2020-04-11 18:02:49 +09:00
Dean Herbert 415adecdf6 Add support for Result fetching 2020-04-11 18:02:43 +09:00
Dean Herbert 832822858c Add basic request / response support 2020-04-11 17:48:23 +09:00
Dean Herbert 7ecce713bb Keep provided IDs where possible if not online 2020-03-30 15:07:39 +09:00
smoogipoo 2187523bf3 Fix json web requests having incorrect user agents 2020-01-17 19:21:27 +09:00
Dean Herbert 0d8b4e7c3e Fix user agent missing in registration 2020-01-16 12:51:43 +09:00
Roman Kapustin e8bcb52612 Set UserAgent for API requests 2019-12-28 18:07:55 +03:00
Huo Yaoyuan d7b3578cc6 CA2201: throw correct exception type. 2019-12-17 13:00:02 +08:00
Dean Herbert 45514ff660 Apply fixes 2019-11-25 11:30:55 +09:00
Dean Herbert 19dfbb0a45 Update obsolete usages 2019-11-21 10:55:31 +09:00
Dean Herbert 58df6930b2 Get error message from server 2019-11-12 19:34:20 +09:00
Dean Herbert c83db94eb7 Use isolated storage/api 2019-09-25 15:00:08 +09:00
Dean Herbert 90acc9b6ca Avoid calling api request callback after user cancel 2019-06-25 13:52:43 +09:00
Dean Herbert f0114d776d Use interface to access API
Allows for better testability.
2019-03-13 12:58:18 +09:00
Dean Herbert 26d53d06a9 Fix remaining issues 2019-02-28 13:31:40 +09:00
Dean Herbert 8617aaa2a7 Update licence header (and remove year) 2019-01-24 17:43:03 +09:00
Dean Herbert bfbd7e5106 Merge remote-tracking branch 'upstream/master' into timeshift-wip 2018-12-26 22:42:24 +09:00
smoogipoo bee4e8ad28 Fix cancelled webrequests triggering exceptions 2018-12-26 21:17:10 +09:00
smoogipoo 5d59a1ffca Merge remote-tracking branch 'origin/master' into timeshift-wip
# Conflicts:
#	osu.Game.Tests/Visual/TestCasePollingComponent.cs
#	osu.Game/Online/API/APIRequest.cs
#	osu.Game/osu.Game.csproj
2018-12-21 12:51:31 +09:00
Dean Herbert 6088612a26 Remove all retry logic and simplify overall handling of API requests 2018-12-18 20:20:17 +09:00
smoogipoo 87ebb00f1c Make Target abstract (should absolutely always be set) 2018-12-12 19:03:27 +09:00
Dean Herbert 21c8ef576c Expose result for synchronous consumption 2018-06-08 14:37:48 +09:00
Dean Herbert b265f02d56 Add comment about scheduled invocation 2018-06-08 14:37:27 +09:00
Dean Herbert 645f6efce7 Fix web request failures not being correctly handled at an APIRequest level 2018-06-03 13:01:52 +09:00
Dean Herbert 32a74f95a5 Normalize all the line endings 2018-04-13 18:26:38 +09:00
Dean Herbert ce2997419a Expose API scheduling internally 2018-03-14 11:37:50 +09:00
Dean Herbert e0d28564d0 Move import logic to shared implementation 2018-02-15 14:22:39 +09:00
Dean Herbert 37d393bca0 Update licence headers 2018-01-05 20:21:19 +09:00
smoogipoo cd5324f1d1 Update API code to use the new Add* methods on requests 2017-10-30 21:33:44 +09:00
smoogipoo f94505243d Use AllowRetryOnTimeout where to maintain previous functionality 2017-10-30 17:28:53 +09:00
smoogipoo b59401357e Remove singular RetryCount usage, update framework 2017-10-27 12:53:08 +09:00
smoogipoo bfee3317aa Update WebRequest usage in-line with framework 2017-10-26 16:37:44 +09:00