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

fix: send missing app install messages on install / uninstall #208

Merged
merged 2 commits into from
May 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion app/apps/impl/raspiblitz.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ async def run_bonus_script(self, app_id: str, params: str):
"id": app_id,
"mode": mode,
"result": "fail",
"details": "install script did not ran thru",
"details": "install script threw an error",
},
)
# nothing above consider success
Expand Down Expand Up @@ -304,6 +304,9 @@ async def run_bonus_script(self, app_id: str, params: str):
"details": stdoutData["result"],
},
)
await broadcast_sse_msg(
SSE.INSTALLED_APP_STATUS, [updatedAppData]
)
else:
logging.error(f"FAIL - {app_id} was not installed")
logging.debug(f"updatedAppData: {updatedAppData}")
Expand All @@ -317,8 +320,15 @@ async def run_bonus_script(self, app_id: str, params: str):
"details": "install was not effective",
},
)
await broadcast_sse_msg(
SSE.INSTALLED_APP_STATUS, [updatedAppData]
)

elif mode == "off":
await broadcast_sse_msg(
SSE.INSTALL_APP,
{"id": app_id, "mode": mode, "result": "win"},
)
await broadcast_sse_msg(SSE.INSTALLED_APP_STATUS, [updatedAppData])

if not updatedAppData["installed"]:
Expand Down