[GH-ISSUE #22] Bug: like button does not work #19

Closed
opened 2026-02-26 21:30:48 +03:00 by kerem · 1 comment
Owner

Originally created by @Basthet on GitHub (Feb 5, 2026).
Original GitHub issue: https://github.com/fspecii/ace-step-ui/issues/22

The like button (the heart in the Song Detail panel) on the very right does not work

SQL: INSERT INTO liked_songs (user_id, song_id) VALUES (?, ?)
Params: [ '5f974cfb-f271-445f-a026-9999f4a16e23', '[object Object]' ]
Like song error: SqliteError: FOREIGN KEY constraint failed
    at executeQuery (/home/stefan/git/ace-step-ui/server/src/db/pool.ts:102:45)
    at SqliteClient.query (/home/stefan/git/ace-step-ui/server/src/db/pool.ts:118:12)
    at SqliteClient.client.query (/home/stefan/git/ace-step-ui/server/src/db/pool.ts:163:14)
    at <anonymous> (/home/stefan/git/ace-step-ui/server/src/routes/songs.ts:472:20)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5) {
  code: 'SQLITE_CONSTRAINT_FOREIGNKEY'
Originally created by @Basthet on GitHub (Feb 5, 2026). Original GitHub issue: https://github.com/fspecii/ace-step-ui/issues/22 The like button (the heart in the Song Detail panel) on the very right does not work ``` SQL: INSERT INTO liked_songs (user_id, song_id) VALUES (?, ?) Params: [ '5f974cfb-f271-445f-a026-9999f4a16e23', '[object Object]' ] Like song error: SqliteError: FOREIGN KEY constraint failed at executeQuery (/home/stefan/git/ace-step-ui/server/src/db/pool.ts:102:45) at SqliteClient.query (/home/stefan/git/ace-step-ui/server/src/db/pool.ts:118:12) at SqliteClient.client.query (/home/stefan/git/ace-step-ui/server/src/db/pool.ts:163:14) at <anonymous> (/home/stefan/git/ace-step-ui/server/src/routes/songs.ts:472:20) at process.processTicksAndRejections (node:internal/process/task_queues:104:5) { code: 'SQLITE_CONSTRAINT_FOREIGNKEY' ```
kerem closed this issue 2026-02-26 21:30:48 +03:00
Author
Owner

@fspecii commented on GitHub (Feb 5, 2026):

Hi @Basthet, good catch! This is now fixed.

The bug was in the right sidebar — it was passing the entire Song object to the like handler instead of just the song ID. SQLite was receiving [object Object] as the song_id, which caused the foreign key error.

Fix: onToggleLike?.(song)onToggleLike?.(song.id)

Pull the latest and the heart button in the Song Detail panel should work now.

<!-- gh-comment-id:3856174815 --> @fspecii commented on GitHub (Feb 5, 2026): Hi @Basthet, good catch! This is now fixed. The bug was in the right sidebar — it was passing the entire Song object to the like handler instead of just the song ID. SQLite was receiving `[object Object]` as the song_id, which caused the foreign key error. Fix: `onToggleLike?.(song)` → `onToggleLike?.(song.id)` Pull the latest and the heart button in the Song Detail panel should work now.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ace-step-ui#19
No description provided.