-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Notification system (#1766)
* added websocket reconnect javascript * timeout fix * FIXED server timout issue * working port config * added websockets * fixed cypress test * graceful exit, but client is slow * fast shutdown * Switch to other port, if this one is blocked * better error handling * undid the port retrying * trying CI with different port for websockets * added getting port from ENV * test CI with longer wait time for cypress * reset wait time to 1000 * test fix * doc * Bugfix: Flash cannot be called without a context. If a WebAPI (initiated from a different thread) fails, and flash is acalled as a backup the flash is without context. Now I simply added a attribute that flash cannot be called from any thread. It now skips it during the "Trying to rebroadcast" * restore feature that the WebAPI permission is updated * js formatting * doc and reshuffling methods * localhost fix for cypress * fixed bug that i introduced recently. * doc * refactoring * refactoring * fix bug and refactoring * removed use_reloader=false * made the CreateNotification more robust * better log * bug fix * pytest fix * bug fix * pytest works... but ugly * do not start the websockets server in the tests * Introducing SPECTER_WEBSOCKET_ACTIVE * fix for incomplete SPECTER_WEBSOCKET_ACTIVE * fix for incomplete SPECTER_WEBSOCKET_ACTIVE * working websockets server shutdown when main thread dies * doc * camelCase for js also changed WebAPI --> webapi * better naming * ssl working for python client and server, but not javascript * minimal working example for self-signed ssl * working minimal echo server in specter works with self signed cert * working user recognition * working websocket server. The client shows an ssl error * added ssl_context, but doesn't work yet * no error... not tested yet * working * working, but not in js yet * almost working!!! * client is not working * still cannot get a 1 server to many clients working * minimal client example * working minimal exaple to send to all connected clients * working (at first, but then disconnecting) * working. but cient needs some simplifications * working great!!! * fix closing connection handling * also for non ssl working * doc and requirements * better config * fix for multiple connections of 1 user * imports * doc * better logging * added endpoint to test * cleanup * added a possibility to quit websocket connections via a special command. * fix error message * doc * refactoring * remove old code * undo * Docs: Add mobile access question to the FAQ (#1829) * starting pytest pytest mocking doesn't work yet working pytest * better descriptions * more notification arguments * added pytest * move notifications.js such that it is always available * fix css issue * A test-page in the devhelper extension * defaults that shows a message without changing values * doc and rename: clarifying point about the flask flash * improved logging formatting * js_message_box reflects noy the notification_type * doc addressing #1766 (comment) * doc addressing #1766 (comment) * fix pytest * doc and use get instead of [] * redirect flash call * feature now complete * documentation * rename callback * Adding add_wallettab * moving to server_endpoints * proper removal * refactor robust_json_dumps import * forgot one reference of robust_json_dumps * remove unintended changes * import fixes and polishing * docs revised * working notifications * working almost completely moved * not working yet.... somehow sending to the server doesn't work. * working * added TODO * redirect flash * fix for flash * implemented callbacks Can test with js code a = await pythonCommand("app.specter.service_manager.execute_ext_callbacks( 'create_and_show_notification', 'title', target_uis='js_message_box', timeout=3000)") * invisible in sidebar and enabled by default * added logo * adding wallet_alias and docs * pictures for the docs * added import * forgotten change * pytest fix * forgotten part 2 * add HOST to config and fix pytest * examples in settings and wallet menu * app is not required in callback_after_serverpy_init_app * better error logging * fix: better error logging * fix: include * Removing Werkzeug Request logs for Cypress * selectWallet twice to fix weird issues * explicitly returing None if no user found * better structuring in server function * reset lots of flash changes * add timeout for websocket server connections * reset helpers.py * added connection_report - also changed the registering logic slightly, to now have an easy overview of the open connections - also added constants INTERNAL_NOTIFICATION_TITLES * better default services in user.py * tiny cleanup * avoid slow_request_detection_stop * move css #1766 (comment) * typo #1766 (comment) * callback_cleanup_on_exit #1766 (comment) * move also css colors to service * upgrade simple_websocket got rid of ssl error on close connection * fix tests * better default loading of notifications * fix bug see #1766 (comment) * better callback_cleanup_on_exit * deleted files * fix 1 pytest * removed example code #1766 (comment) * cleaned up js logic for the initial connection * moved sendRequest * doc * doc * increase ping/timeout interval, because the websocket connection closure works well now * increase migration count * renaming * changed order of notifications cypress test * disable the websockets during all pytest * reenable websockets for cypress * fix bug * pytest debugging ONLY. Have to rollback * Revert "pytest debugging ONLY. Have to rollback" This reverts commit ccee38f. * info output for pytest debugging * pytest experiment... Can be rolled back. * Revert "info output for pytest debugging" This reverts commit 07f3aaa. * fix see #1907 (comment) * added view_functions comment * trying to fix flaky cpyress * fix for hardcoded url * added auto-reconnection on request failiure * remove user_secret_decrypted_required * remove user_secret_decrypted_required * Removed verbose logging unless logging level < 10 * remove verbose_debug from notification.id * fix * fix pytest * fix non-working migration * set devstatus_alpha and opt-in * delete cypress test and remove migration from pytest * len(classlist) seems to differ in CI and locally * remove useless code * done #1766 (comment) - removed duplicate sendRequest * moved service_manager_cleanup_on_exit see #1766 (comment) * added comment see #1766 (comment) * attempt to fix #1766 (comment) * pytest works. Was a variation in requirements.txt --------- Co-authored-by: Manolis Mandrapilias <[email protected]> Co-authored-by: Kim Neunert <[email protected]> Co-authored-by: moneymanolis <[email protected]>
- Loading branch information
1 parent
40a6a2e
commit 8eef5c7
Showing
40 changed files
with
2,888 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
from flask import flash as flask_flash | ||
from flask import current_app as app | ||
from ..services import callbacks | ||
|
||
|
||
def flash(*args, **kwargs): | ||
"""An indirection in order to potentially handle a flash differently | ||
This function could be placed in util but as it might | ||
use the service_manager, we place it here for now. | ||
""" | ||
flask_flash(*args, **kwargs) | ||
|
||
return_values = app.specter.service_manager.execute_ext_callbacks( | ||
callbacks.flash, *args, **kwargs | ||
) | ||
|
||
# if no extension handled the callback | ||
if not return_values: | ||
flask_flash(*args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.