Repository navigation
fix(parser): Add InlineSurvey, ExpandableSurveyResponse, RatingSurvey and RatingSurveyOption - #1318
Open
ChandraChaan wants to merge 1 commit into
Open
ChandraChaan wants to merge 1 commit into
ChandraChaan wants to merge 1 commit into
Conversation
…urvey` and `RatingSurveyOption` getHomeFeed() can return an inline survey card, and the parser warned that all four of its nodes were not found and generated classes at runtime. RatingSurveyOption keeps followUpCommand and responseEndpoint as separate endpoints instead of the single `endpoint` the generated class assigned twice. Fixes LuanRT#1173
Author
|
The lint and test workflows here are waiting for approval, so I ran them on my fork and both pass: lint https://github.com/ChandraChaan/YouTube.js/actions/runs/41391258443, test https://github.com/ChandraChaan/YouTube.js/actions/runs/41391258432. Neither runs |
This file contains hidden or 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
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.
Fixes #1173.
getHomeFeed()can return an inline survey card ("How do you feel about this video?"), and the parser logs fournot found!warnings for it (InlineSurvey,ExpandableSurveyResponse,RatingSurvey,RatingSurveyOption) and falls back to JIT-generated classes.This adds the four classes, following the field shapes in the issue, and registers them in
src/parser/nodes.tsin the ordergen-parser-map.mjsproduces:InlineSurvey:title,subtitle,dismissal_text,inline_content(CompactVideo),response(ExpandableSurveyResponse),dismissal_endpoint,impression_endpoints.ExpandableSurveyResponse:options(RatingSurvey),submit_button.RatingSurvey:ratings(RatingSurveyOption[]),undo_button.RatingSurveyOption:response_text,default_state_icon_type,on_state_icon_type, andfollow_up_endpoint/response_endpointkept separate. The generated class in the issue assigned both commands to the sameendpointfield, so the response endpoint overwrote the follow-up command.This builds on #1186, which added the same nodes but was closed as stale without review. The differences are the separate endpoints above,
dismissalEndpoint/impressionEndpointsread only when present, and the current class style (noprototype.type,Parser.parseArray).How to test: call
getHomeFeed()on an account that is shown the survey card; the four warnings no longer appear and the card is available as anInlineSurveynode.Not verified: I couldn't run
npm run lint,tscor the test suite locally, and I haven't seen the survey card on a live home feed myself. The classes are written against the response shape posted in #1173.