ably-flutter icon indicating copy to clipboard operation
ably-flutter copied to clipboard

Stats function implementation

Open ikurek opened this issue 3 years ago • 0 comments

This is a rework of https://github.com/ably/ably-flutter/pull/283 because the previous PR was made from enhancement/formatting and the branch can't be merged. The logic had to be extended, since the solution presented in previous PR didn't work.

Original description from #283:

This PR includes full implementation of Rest.stats function for Flutter plugin. As stats is a slightly complicated and big object, this pull request might seem a bit huge but the scope is still just a map of a function. Implemenation contains

  • New type definitions on Flutter side for code generation
  • New encoders for Java
  • New encoders for Swift/Objective-C
  • Function mappings
  • A paginated result viewer addition to example app

There were some differences between native implementations:

  • Structures were formed slightly differently. I created an issue in ably-java for this
  • Stats structure is not fully compatible with spec ably-java#733

The way stats params were received was a bit more structured in Objective C than Java. In Objective C there is a dedicated object for this, where it's a Param[] in Java. I have created a separate category in Objective C to build that object from the map sent from Dart side.

Additions from my side:

  • Removed unnecessary formatting and changes
  • Fixed issue with null handle being passed to iOS method
  • Implemented dart decoder for Stats objects

This pull request remains blocked untill ably-java#733 and ably-cocoa#1284 are resolved, so I'm leaving it as a draft

ikurek avatar Feb 08 '22 17:02 ikurek

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3492

sync-by-unito[bot] avatar Apr 05 '23 01:04 sync-by-unito[bot]