fix(conflicts): use ListConflictsByUser in DismissAllResolved so resolved conflicts are found
DismissAllResolved was calling ListSyncConflictsByUser which filters to 'unresolved' conflicts only, so it could never find the user_resolved or bulk_resolved conflicts it was trying to delete. The query always returned an empty set, making dismiss-all a no-op. Fix the leading space in three SQL query name annotations (ListConflictsByUser, ListAllConflictsByUserAndStatus, CheckForProgressConflicts) that prevented sqlc from generating their Go functions. Regenerate the query code and swap DismissAllResolved to use ListConflictsByUser (no status filter) — the existing Go loop already filters by resolution_status.
This commit is contained in:
@@ -401,7 +401,7 @@ func (h *ConflictHandler) DeleteConflict(c *echo.Context) error {
|
||||
func (h *ConflictHandler) DismissAllResolved(c *echo.Context) error {
|
||||
user := c.Get("user").(database.Users)
|
||||
|
||||
conflicts, err := h.db.ListSyncConflictsByUser(context.Background(), user.ID)
|
||||
conflicts, err := h.db.ListConflictsByUser(context.Background(), user.ID)
|
||||
if err != nil {
|
||||
return echo.NewHTTPError(http.StatusInternalServerError, "failed to list conflicts")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user