fix: address performance and security findings
- Add PostgreSQL-backed backend and frontend tests to CI - Harden Android API logging and disable app backups - Update the performance report with resolved findings
This commit is contained in:
1 parent
a84a36349b
commit
937f51b4fb
35 files changed
+2566
-332
No files matched your search
@@ -41,6 +41,31 @@ func enqueueNotification(
|
||||
return err
|
||||
}
|
||||
|
||||
// enqueueNotificationInTx writes a notification inside a savepoint. PostgreSQL
|
||||
// aborts the whole transaction after any failing statement, so without the
|
||||
// savepoint a failed notification insert would make the data mutation's commit
|
||||
// fail too.
|
||||
func enqueueNotificationInTx(
|
||||
ctx context.Context,
|
||||
tx pgx.Tx,
|
||||
deviceID string,
|
||||
eventType string,
|
||||
entityType string,
|
||||
entityID string,
|
||||
listID string,
|
||||
createdAt int64,
|
||||
) error {
|
||||
savepoint, err := tx.Begin(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := enqueueNotification(ctx, savepoint, deviceID, eventType, entityType, entityID, listID, createdAt); err != nil {
|
||||
_ = savepoint.Rollback(ctx)
|
||||
return err
|
||||
}
|
||||
return savepoint.Commit(ctx)
|
||||
}
|
||||
|
||||
func nullableString(value string) any {
|
||||
if value == "" {
|
||||
return nil
|
||||
@@ -48,6 +73,8 @@ func nullableString(value string) any {
|
||||
return value
|
||||
}
|
||||
|
||||
// ignoreNotificationError logs a failed notification. Use it only for
|
||||
// notifications written by enqueueNotificationInTx or outside a transaction.
|
||||
func ignoreNotificationError(err error) {
|
||||
if err != nil {
|
||||
// Notifications are an acceleration path for clients that poll. A failed
|
||||
|
||||
Reference in new issue
Block a user