-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[RNMobile] Fix encoding of MediaInfo
metadata
property (iOS)
#49304
Conversation
We are not customizing the encoding of the MediaInfo so we can rely on the default implementation.
MediaInfo
metadata propertyMediaInfo
metadata
property
MediaInfo
metadata
propertyMediaInfo
metadata
property (iOS)
It's interesting because I can't reproduce it when using Xcode 14+. In fact, I only get it when using Xcode 13 🤔. I'll check this deeper. UPDATE: This is actually caused by the Swift version:
Specifically, seems related to a new feature introduced in |
Seems that using Xcode 14 in CI could do the trick but, as discussed internally with @geriux, we can't do this without bumping Appium to version 2. Since this is out of the scope of the fix, I'll drop this approach and work on a different one. Hence I'm changing the PR to draft. |
I dropped using the type The PR is ready for review again, thanks! |
Flaky tests detected in 04ee4cf. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4501782410
|
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.
Related PRs:
MediaInfo
metadata
property (iOS) wordpress-mobile/gutenberg-mobile#5584What?
Fix encoding of
MediaInfo
metadata
property passed when inserting media in a Media block. This fix only affects iOS.NOTE: This bug is not affecting the editor's logic as
metadata
property is not being used yet.Why?
The metadata property was introduced in #48994, however, the way it's encoded doesn't match the expectations:
Note that in the current output, it's returning an array but it should be a plain object.
How?
The main complexity of encoding
metadata
property is that we don't know its structure which is a requirement when encoding anEncodable
class/struct. I tried using a generic type but still, it led to other issues. Finally, I decided to omit the property when encodingMediaInfo
andencodeadd themetadata
manually inencodeForJS
function when we pass the data to React Native.Additionally, I removed the
encode
function fromMediaInfo
. In theory, if we don't customize the encoding (i.e. use a different name or value) we can rely on the default implementation.Testing Instructions
Preparation:
Image block
Video block
Testing Instructions for Keyboard
N/A
Screenshots or screencast
N/A