-
Notifications
You must be signed in to change notification settings - Fork 95
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
maintained RpcReqError with headers in vkext #915
Merged
DrDet
merged 5 commits into
master
from
dvaksman/vkext/maintain-rpc-req-error-with-header-lookup
Oct 24, 2023
Merged
maintained RpcReqError with headers in vkext #915
DrDet
merged 5 commits into
master
from
dvaksman/vkext/maintain-rpc-req-error-with-header-lookup
Oct 24, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DrDet
force-pushed
the
dvaksman/vkext/maintain-rpc-req-error-with-header-lookup
branch
2 times, most recently
from
October 13, 2023 17:17
29a6ef1
to
176c8f5
Compare
KokorinIlya
reviewed
Oct 14, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Парсинг выглядит ок
DrDet
force-pushed
the
dvaksman/vkext/maintain-rpc-req-error-with-header-lookup
branch
2 times, most recently
from
October 19, 2023 16:18
f5e92de
to
88d28fd
Compare
DrDet
changed the title
WIP: maintained RpcReqError with header in vkext
maintained RpcReqError with headers in vkext
Oct 19, 2023
…turned off by default
Hidanio
previously approved these changes
Oct 24, 2023
troy4eg
previously approved these changes
Oct 24, 2023
troy4eg
approved these changes
Oct 24, 2023
DrDet
deleted the
dvaksman/vkext/maintain-rpc-req-error-with-header-lookup
branch
October 24, 2023 16:53
Danil42Russia
added
enhancement
New feature or request
runtime
Feature related to runtime
labels
Dec 10, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
TL error serialization is historically totally broken and doesn't fit the scheme.
By according to TL scheme it must be like this:
kphp/common/tl-files/common.tl
Line 79 in c4031c7
But actually it comes as:
kphp/common/tl-files/common.tl
Line 85 in c4031c7
rpcReqError#7ae432f5
is outer error, but it's fetched as inner one instead ofreqError#b527877d
, while latter is never used at all.Problem
This weird deserialization is done via workaround as
tl_fetch_lookup
right before the answer fetching. And it's done inconsistently: if we require extra response headers via:kphp/common/tl-files/common.tl
Line 47 in c4031c7
we will get the error on parsing them in case of the error, although in case of normal response everything is fine.
Changes
Now we can successfully fetch error with extra fields (header), if we require them.
In typed mode it's fetched as
rpcResponseHeader
object, containingrpcResponseError
in its$result
field.It doesn't fit php-doc types, but it's fair, because it doesn't fit TL scheme at all.
This approach seems for me the best option, as it helps to avoid extra related workarounds in
tl2php
,tlo-parser
,kphp
, etc.In
kphp
headers will just be skipped andrpcResponseError
will be returned as usual.In the future this workaround will be fixed, and serialization will fit the TL scheme and work correctly in
kphp
andvkext
the same way.