Skip to content
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

Transport layer #225

Merged
merged 33 commits into from
Oct 29, 2024
Merged

Transport layer #225

merged 33 commits into from
Oct 29, 2024

Conversation

mohitpubnub
Copy link
Contributor

@mohitpubnub mohitpubnub commented Sep 23, 2024

feat(transport layer): Added new implementation for transport middleware.

Tasks Checklist:

  • new execution flow implemented for http request.
  • Update File Upload.
  • Update Subscribe.

Copy link
Contributor

@jakub-grzesiowski jakub-grzesiowski left a comment

Choose a reason for hiding this comment

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

Initial review, mostly pedantry

src/Api/PubnubApi/ClientNetworkStatus.cs Outdated Show resolved Hide resolved
src/Api/PubnubApi/ClientNetworkStatus.cs Outdated Show resolved Hide resolved
src/Api/PubnubApi/EndPoint/Files/SendFileOperation.cs Outdated Show resolved Hide resolved
}
else if (enumValue.ToLowerInvariant() == "uuid_custom")
{
ret = "uuid.custom";
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I've seen this conversion in another file, can this method be put once into a util?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's required conversation between C# request object and Rest api query parameter key values, So if something is going to change, we need to update this conversation.

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean if we can move MapEnumValueToEndpoint method to a static util since it's repeated at endpoints but doesn't seem to have significant variation in how it translates the values?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it.
Agree! moving it to a common place...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactored! at bbd62a4

good catch!

src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager2.cs Outdated Show resolved Hide resolved
jakub-grzesiowski and others added 3 commits October 7, 2024 13:35
* temporarily remove one assert from TestSubscribeDecryptionOnNonEncryptedMessage

* re-enable unit tests on branch

* disable stub test

* remove channels argument exception from UrlRequestBuilder

* temporarily disable tests that were causing the CI to hang

* update key-set used by tests

* Fix broken Encryption tests

* Disable global HereNow tests (for now)

* re-enable access manager dependant tests

* Revert "re-enable access manager dependant tests"

This reverts commit dff644b.

* Test increased timeouts in ThenManageMembershipShouldReturnEventInfo

* Revert "Test increased timeouts in ThenManageMembershipShouldReturnEventInfo"

This reverts commit fc129da.

* Fix potentially faulty async calls in EncryptionTests

* Increase verbosity for CI debugging

* test increasing --logger verbosity

* add a NUnit ConsoleTraceListener

* add a simple debug writeline to test logging

* Update .pubnub.yml for .Net version support (#223)

* fix encryption tests PAM issue

* Fix more of file tests

* add missing test teardowns, replace v2 PAM access grants with v3 ones in tests that got a PAM 403

* change to PAM v3 in WhenObjectChannelMetadata

* failing test debug assert

* add temp debug method for PubnubCommon values

* Change PAM v2 to v3 in more tests, more failing test debug

* update .yml test keys ids

* add debug to failing ci test

* debug on file tests

* tests yml sdk keys change

* remove old test debugs

* Remove deprecated build targets

* Fix missing UWP includes

---------

Co-authored-by: Mohit Tejani <[email protected]>
* Added support for Patch requests in client library
@mohitpubnub
Copy link
Contributor Author

mohitpubnub commented Oct 9, 2024

@jakub-grzesiowski Please make a note that We have to support HTTP PATCH request for AppContext Apis.
I've added it in contract.

I'm referring this method-

* fix current userId memenership issue for AppContext Api
added request timeout mechanism,
fixes to adhere to existing response generation mechanism by applying request state values as per response
@mohitpubnub
Copy link
Contributor Author

mohitpubnub commented Oct 15, 2024

  • Fix file upload tests
  • Remove commented code
  • Add debug logs in catch clause

@jakub-grzesiowski

mohitpubnub and others added 11 commits October 15, 2024 13:41
…utility directory, moved unnecessary log messages from internet utility method
…er information sent through default http client component
…r handling in default http client library,

removed code for UrlProcess request from PubNubCore class,
fixed issues with generate file url
Code Cleanup for Pubnub, PubnubCoreBase, PNConfiguration class,
Code Cleanup - removed dead codes in various files and removed old PubnubHttpClient footprints.
@mohitpubnub
Copy link
Contributor Author

@jakub-grzesiowski changes at 70011b8 is about serialisation failure in net 6 versions. Because any of conditional compilation clauses not having higher .net version value!!:(

@mohitpubnub
Copy link
Contributor Author

@jakub-grzesiowski Merging this, To have all upcoming release related changes into CLEN-1851

@mohitpubnub mohitpubnub merged commit 684f6cc into CLEN-2074 Oct 29, 2024
5 checks passed
@mohitpubnub mohitpubnub deleted the TransportLayer branch October 29, 2024 06:06
mohitpubnub added a commit that referenced this pull request Oct 29, 2024
* Remove TelemetryManager from the sdk

* Transport layer (#225)

* * Target framework upgrade
* Initial code for HttpClient

* Integration of TransportLayer with all endpoints except File and Subscribe operations

* send and download file apis refactoring

* code cleanup: removed unnecessary usings for threading.channels

* removed support for older netstandartds

* Fix build issues for Unity and UWP projects

* retire old httpWebRequest

* CI Tests Fix (#228)

* temporarily remove one assert from TestSubscribeDecryptionOnNonEncryptedMessage

* re-enable unit tests on branch

* disable stub test

* remove channels argument exception from UrlRequestBuilder

* temporarily disable tests that were causing the CI to hang

* update key-set used by tests

* Fix broken Encryption tests

* Disable global HereNow tests (for now)

* re-enable access manager dependant tests

* Revert "re-enable access manager dependant tests"

This reverts commit dff644b.

* Test increased timeouts in ThenManageMembershipShouldReturnEventInfo

* Revert "Test increased timeouts in ThenManageMembershipShouldReturnEventInfo"

This reverts commit fc129da.

* Fix potentially faulty async calls in EncryptionTests

* Increase verbosity for CI debugging

* test increasing --logger verbosity

* add a NUnit ConsoleTraceListener

* add a simple debug writeline to test logging

* Update .pubnub.yml for .Net version support (#223)

* fix encryption tests PAM issue

* Fix more of file tests

* add missing test teardowns, replace v2 PAM access grants with v3 ones in tests that got a PAM 403

* change to PAM v3 in WhenObjectChannelMetadata

* failing test debug assert

* add temp debug method for PubnubCommon values

* Change PAM v2 to v3 in more tests, more failing test debug

* update .yml test keys ids

* add debug to failing ci test

* debug on file tests

* tests yml sdk keys change

* remove old test debugs

* Remove deprecated build targets

* Fix missing UWP includes

---------

Co-authored-by: Mohit Tejani <[email protected]>

* fix acceptance tests errors

* * fixes issue reported by acceptance tests in AppContextApi.
* Added support for Patch requests in client library

* * added missing includes for UWP (missed in last merge!)
* fix current userId memenership issue for AppContext Api

* * fix: removed references of old http client code,
added request timeout mechanism,
fixes to adhere to existing response generation mechanism by applying request state values as per response

* fix: removeMembership for current user scenario execution

* refactor: moved out enumToUrlParamName conversation utility to build utility directory, moved unnecessary log messages from internet utility method

* fixes issues found in channelGroup, audit, publish, signal operation through unit/integration tests

* files: fix issue of uploading and downloading files due to wrong header information sent through default http client component

* Unit and Integration Tests: increased delay value for Grant response wait.

* * Code cleanup: removed commented code in client library, better error handling in default http client library,
removed code for UrlProcess request from PubNubCore class,
fixed issues with generate file url

* build: update default runner group value with organization

* Add/re-add ConfigureAwait(false) in await calls to prevent Unity-side deadlocks

* Add few more missing ConfigureAwait(false)

* Added Support for Porxy.
Code Cleanup for Pubnub, PubnubCoreBase, PNConfiguration class,
Code Cleanup - removed dead codes in various files and removed old PubnubHttpClient footprints.

* fix: Serialization failure for User publish/signal message at NewtonsoftJsonNet library

* BREAKING CHANGE: Default Reconnection Policy set to `EXPONENTIAL`.
* File upload failure edge cases handling with proper exception messages.
* Refactored Check Internet status execution a bit (many more to come) to fix Unity engine impact.
* Old subscription logic cleanup: removing many state/internetstatus information store

* Unsubscribe operation refactoring: removed unncessary processings

* set default event engine enabled

* removed timer.cs, tuple.cs which was there for older .net versions

* fix: presence tests (passing locally)

* reverted eventengine enabled flag reset for Presence Tests

* update test to have different channel names for presence tests

* presence test fix for 403 permission

* attempt to fix unit/integartion test for subscribe

* fix: Patch work for internet status chekcing execution to make it compatible with single threaded environment.
Disable ee for unit/integration tests

---------

Co-authored-by: PUBNUB\jakub.grzesiowski <[email protected]>
Co-authored-by: jakub-grzesiowski <[email protected]>

---------

Co-authored-by: PUBNUB\jakub.grzesiowski <[email protected]>
Co-authored-by: jakub-grzesiowski <[email protected]>
mohitpubnub added a commit that referenced this pull request Oct 31, 2024
* add entity classes

* added entity implementation

* support for `User` and `Channel`-`Metadata` entities

* UWP: added entity class references

* typo in method name

* acceptance tests using new enttities and event listeners

* remove magic strings

* set `EnableEventEngine` and fix relevant issues

* fix vulnerability alert: example code #199

* fix: handling connection failure status with additional information to user

* `EventListener` class for registering event handlers for each type of event

* refactor: Remove `TelemetryManager` from sdk (#224)

* Remove TelemetryManager from the sdk

* Transport layer (#225)

* * Target framework upgrade
* Initial code for HttpClient

* Integration of TransportLayer with all endpoints except File and Subscribe operations

* send and download file apis refactoring

* code cleanup: removed unnecessary usings for threading.channels

* removed support for older netstandartds

* Fix build issues for Unity and UWP projects

* retire old httpWebRequest

* CI Tests Fix (#228)

* temporarily remove one assert from TestSubscribeDecryptionOnNonEncryptedMessage

* re-enable unit tests on branch

* disable stub test

* remove channels argument exception from UrlRequestBuilder

* temporarily disable tests that were causing the CI to hang

* update key-set used by tests

* Fix broken Encryption tests

* Disable global HereNow tests (for now)

* re-enable access manager dependant tests

* Revert "re-enable access manager dependant tests"

This reverts commit dff644b.

* Test increased timeouts in ThenManageMembershipShouldReturnEventInfo

* Revert "Test increased timeouts in ThenManageMembershipShouldReturnEventInfo"

This reverts commit fc129da.

* Fix potentially faulty async calls in EncryptionTests

* Increase verbosity for CI debugging

* test increasing --logger verbosity

* add a NUnit ConsoleTraceListener

* add a simple debug writeline to test logging

* Update .pubnub.yml for .Net version support (#223)

* fix encryption tests PAM issue

* Fix more of file tests

* add missing test teardowns, replace v2 PAM access grants with v3 ones in tests that got a PAM 403

* change to PAM v3 in WhenObjectChannelMetadata

* failing test debug assert

* add temp debug method for PubnubCommon values

* Change PAM v2 to v3 in more tests, more failing test debug

* update .yml test keys ids

* add debug to failing ci test

* debug on file tests

* tests yml sdk keys change

* remove old test debugs

* Remove deprecated build targets

* Fix missing UWP includes

---------

Co-authored-by: Mohit Tejani <[email protected]>

* fix acceptance tests errors

* * fixes issue reported by acceptance tests in AppContextApi.
* Added support for Patch requests in client library

* * added missing includes for UWP (missed in last merge!)
* fix current userId memenership issue for AppContext Api

* * fix: removed references of old http client code,
added request timeout mechanism,
fixes to adhere to existing response generation mechanism by applying request state values as per response

* fix: removeMembership for current user scenario execution

* refactor: moved out enumToUrlParamName conversation utility to build utility directory, moved unnecessary log messages from internet utility method

* fixes issues found in channelGroup, audit, publish, signal operation through unit/integration tests

* files: fix issue of uploading and downloading files due to wrong header information sent through default http client component

* Unit and Integration Tests: increased delay value for Grant response wait.

* * Code cleanup: removed commented code in client library, better error handling in default http client library,
removed code for UrlProcess request from PubNubCore class,
fixed issues with generate file url

* build: update default runner group value with organization

* Add/re-add ConfigureAwait(false) in await calls to prevent Unity-side deadlocks

* Add few more missing ConfigureAwait(false)

* Added Support for Porxy.
Code Cleanup for Pubnub, PubnubCoreBase, PNConfiguration class,
Code Cleanup - removed dead codes in various files and removed old PubnubHttpClient footprints.

* fix: Serialization failure for User publish/signal message at NewtonsoftJsonNet library

* BREAKING CHANGE: Default Reconnection Policy set to `EXPONENTIAL`.
* File upload failure edge cases handling with proper exception messages.
* Refactored Check Internet status execution a bit (many more to come) to fix Unity engine impact.
* Old subscription logic cleanup: removing many state/internetstatus information store

* Unsubscribe operation refactoring: removed unncessary processings

* set default event engine enabled

* removed timer.cs, tuple.cs which was there for older .net versions

* fix: presence tests (passing locally)

* reverted eventengine enabled flag reset for Presence Tests

* update test to have different channel names for presence tests

* presence test fix for 403 permission

* attempt to fix unit/integartion test for subscribe

* fix: Patch work for internet status chekcing execution to make it compatible with single threaded environment.
Disable ee for unit/integration tests

---------

Co-authored-by: PUBNUB\jakub.grzesiowski <[email protected]>
Co-authored-by: jakub-grzesiowski <[email protected]>

---------

Co-authored-by: PUBNUB\jakub.grzesiowski <[email protected]>
Co-authored-by: jakub-grzesiowski <[email protected]>

* fix: unsubscribe issue due to duplicate channles/groups

* fix: `HereNow` issue with async- showing error: true even with status 200

* added logging to httpClient Service, optional parameter support in Pubnub constructor for middleware and client library

* Add some more missinng ConfigureAwait(false)

* PubNub SDK v7.0.0.0 release.

---------

Co-authored-by: PUBNUB\jakub.grzesiowski <[email protected]>
Co-authored-by: jakub-grzesiowski <[email protected]>
Co-authored-by: PubNub Release Bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants