Skip to content

Commit

Permalink
Update backend to avoid persisting entries to be read by devices that…
Browse files Browse the repository at this point in the history
… have been uninstalled
  • Loading branch information
ddworken committed Apr 28, 2024
1 parent 0d6bf20 commit d6a6021
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/server/internal/database/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (db *DB) CreateDevice(ctx context.Context, device *Device) error {

func (db *DB) DevicesForUser(ctx context.Context, userID string) ([]*Device, error) {
var devices []*Device
tx := db.WithContext(ctx).Where("user_id = ?", userID).Find(&devices)
tx := db.WithContext(ctx).Where("user_id = ? AND uninstall_date IS NULL", userID).Find(&devices)
if tx.Error != nil {
return nil, fmt.Errorf("tx.Error: %w", tx.Error)
}
Expand Down

0 comments on commit d6a6021

Please sign in to comment.