From f19f2b4c9a878a0a33606fc49d830505c2381874 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Thu, 27 Apr 2023 08:08:45 +0100 Subject: [PATCH 1/2] Fix for subscriptions not working after hibernate update. --- .../java/me/kavin/piped/server/handlers/auth/FeedHandlers.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/me/kavin/piped/server/handlers/auth/FeedHandlers.java b/src/main/java/me/kavin/piped/server/handlers/auth/FeedHandlers.java index d867d68..f3884a6 100644 --- a/src/main/java/me/kavin/piped/server/handlers/auth/FeedHandlers.java +++ b/src/main/java/me/kavin/piped/server/handlers/auth/FeedHandlers.java @@ -424,7 +424,7 @@ public class FeedHandlers { CriteriaBuilder cb = s.getCriteriaBuilder(); var query = cb.createQuery(Channel.class); var root = query.from(Channel.class); - var subquery = query.subquery(User.class); + var subquery = query.subquery(String.class); var subroot = subquery.from(User.class); subquery.select(subroot.get("subscribed_ids")) From 7470554973d7dffe088ba892ab3b4974b9c32b30 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Thu, 27 Apr 2023 08:08:55 +0100 Subject: [PATCH 2/2] Add test for subscriptions. --- testing/api-test.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testing/api-test.sh b/testing/api-test.sh index 0f50abc..8e2b578 100755 --- a/testing/api-test.sh +++ b/testing/api-test.sh @@ -104,6 +104,9 @@ curl "${CURLOPTS[@]}" $HOST/import -X POST -H "Content-Type: application/json" - # Wait 2s to allow the subscription request to be processed sleep 2 +# Check Subscriptions +curl "${CURLOPTS[@]}" $HOST/subscriptions -H "Authorization: $AUTH_TOKEN" || exit 1 + # Check Feed curl "${CURLOPTS[@]}" $HOST/feed -G --data-urlencode "authToken=$AUTH_TOKEN" || exit 1