Skip to content

Conversation

oguzkocer
Copy link
Contributor

This PR updates WpNetworkRequest to be derived from uniffi::Object and starts using WpNetworkHeaderMap internally as opposed to the prior HashMap. It also introduces WpNetworkRequestBody, which at the moment is just a wrapper around Vec<u8> and shares its contents by cloning it. In the future, we might switch it to use interior mutability to give up ownership of the contents instead.

Adds WpNetworkHeaderMap::to_map so that the Kotlin & Swift wrappers can build the headers from it.

To Test

  • make test-server && make dump-mysql && make backup-wp-content-plugins
  • cargo test --test '*' -- --test-threads 1
  • cd native/kotlin && ./gradlew :api:kotlin:integrationTest

@oguzkocer oguzkocer added this to the 0.1 milestone Jul 2, 2024
@oguzkocer oguzkocer requested a review from jkmassel July 2, 2024 21:33
Base automatically changed from login-flow to trunk July 2, 2024 22:30
@oguzkocer oguzkocer closed this Jul 2, 2024
@oguzkocer oguzkocer force-pushed the wp-network-request-as-uniffi-object branch from 0d8eb72 to 1791df3 Compare July 2, 2024 22:34
@oguzkocer oguzkocer reopened this Jul 2, 2024
@oguzkocer oguzkocer marked this pull request as ready for review July 2, 2024 22:37
Copy link
Contributor

@jkmassel jkmassel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integrated nicely with Swift.

I asked @oguzkocer on Slack if we should have toFlatMap be in the Rust layer, not Swift, but for now we're happy to leave it as-is.

@jkmassel jkmassel enabled auto-merge (squash) July 3, 2024 20:25
@jkmassel jkmassel merged commit 01e6456 into trunk Jul 3, 2024
@jkmassel jkmassel deleted the wp-network-request-as-uniffi-object branch July 3, 2024 20:36
@oguzkocer oguzkocer added the Swift label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants