-
Notifications
You must be signed in to change notification settings - Fork 648
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
Fix cancel_all_subscriptions API #762
Comments
The documentation states that the boolean is indeed intended to clear filters. The code however says that this boolean dictates if a notification is sent on object creation and removal. If set to true, an FC_ASSERT can fail if the application option "enable subscribe to all" is not set (note: this assert is not in the master branch, but does exist in the develop branch). For details see bitshares-core/libraries/app/database_api.cpp Line 332 in cdc2db3
Therefore, the fix would be to adjust the documentation. Correct? |
The set_subscribe_callback documentation has been fixed in develop branch. This ticket is to rewrite |
Questions:
I cannot imagine a real use case, but here is a contrived example:
Would the user expect that the previous subscriptions to (1) accounts and (2) markets be maintained? |
Refactor cancel_all_subscriptions (Issue #762)
Merged #1009. Closing. |
For clients, it's not broken. However, the implementation need to be improved. It now calls
set_subscribe_callback( std::function<void(const fc::variant&)>(), true)
. I think usingtrue
as the second parameter here meant to clear filters according to the API document, but the document was wrong. Theset_subscribe_callback
function will always clear filters, and its second parameter is for something else, setting it totrue
may trigger an exception when #752 is done.Update:
The set_subscribe_callback documentation has been fixed in develop branch.
This ticket is to rewrite
cancel_all_subscriptions
to do real cleanups, and perhaps refactorit and
set_subscribe_callback
to call same cleanup function rather than having same code in both functions.The text was updated successfully, but these errors were encountered: