-
-
Notifications
You must be signed in to change notification settings - Fork 584
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
POWERSYNC prototype: add migration to create postgresql publication #1747
base: master
Are you sure you want to change the base?
Conversation
This is needed since the move to vite on the react side
This wasn't working well with when used over the API
This still needs to be clean up (specially the key generation, at the moment we use a new dependency, but all this can be also done with the library we currently use)
try: | ||
return JsonResponse({'token': token, 'powersync_url': settings.POWERSYNC_URL}, status=200) | ||
except Exception as e: | ||
return JsonResponse({'error': str(e)}, status=500) |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Stack trace information
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 9 days ago
To fix the problem, we need to ensure that detailed exception messages are not exposed to the end user. Instead, we should log the detailed error message on the server and return a generic error message to the client. This can be achieved by modifying the exception handling in the get_powersync_token
function.
- Import the
logging
module if not already imported. - Replace the line that returns the detailed error message with a line that logs the error and returns a generic error message.
-
Copy modified lines R458-R459
@@ -457,3 +457,4 @@ | ||
except Exception as e: | ||
return JsonResponse({'error': str(e)}, status=500) | ||
logging.error(f'Error in get_powersync_token: {str(e)}') | ||
return JsonResponse({'error': 'An internal error has occurred.'}, status=500) | ||
|
most convenient and should be just fine
This is only needed because powersync can't handle joins
This reverts commit c6163de.
- move create publication to core - use ivm entries for the nutrition publications
# Conflicts: # wger/core/static/react/main.js
This is needed in the flutter app to properly be able to set IDs on device, since the regular IDs can only be set by postgres.
No description provided.