chucker icon indicating copy to clipboard operation
chucker copied to clipboard

Support for manual transaction logging

Open aliab opened this issue 1 year ago • 5 comments

:page_facing_up: Context

Add Support for manual transaction logging in the chucker. For example, developers can populate MQTT or FCM messages transactions into their chucker log; these are other types of network traffic, and showing them in chucker makes this library more generic for network transaction logging.

:pencil: Changes

  • I've added added saveTransaction(transaction: ManualHttpTransaction) method to ChuckerCollector to save manual transaction data into DB.
  • I've added a new ManualHttpTransaction entity to the API package for the manual type of logging. It is wrapped over the internal HttpTransaction entity and ensures that previous visibility is not violated.

:no_entry_sign: Breaking

No breaking changes introduced

:hammer_and_wrench: How to test

Just run the sample app. The new ManualTransactionTask is added to the sample app MainActivity httpTasks to test if this feature is working OK.

aliab avatar Jul 20 '22 14:07 aliab

I've checked issues and found that issue #140 also wants this feature.

aliab avatar Jul 20 '22 14:07 aliab

Thanks for sending this @aliab 🙏 I think we can simplify this a bit

cortinico avatar Jul 30 '22 16:07 cortinico

Thanks for sending this @aliab 🙏 I think we can simplify this a bit

I tried to make as few changes as possible. btw, I want this feature in my app and if you give me a hint about your idea, maybe I could deliver it sooner.

aliab avatar Aug 03 '22 11:08 aliab

@cortinico kindly reminder

aliab avatar Aug 13 '22 12:08 aliab

@cortinico kindly reminder

Hey @aliab I've took a closer look at this change and I think we can't merge it now. Specifically as I'd like to focus on:

  • https://github.com/ChuckerTeam/chucker/issues/259
  • https://github.com/ChuckerTeam/chucker/issues/579

Exposing the Manual class you suggested exposes us to having to maintain this in the long run. As we're planning on potentially separating requests and responses, having a class in the public API which doesn't follow this design would be harder to maintain the future.

Let's get back to this once we're done with the redesign.

cortinico avatar Sep 10 '22 15:09 cortinico