Highly ambitious ATProtocol AppView service and sdks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

sqlx cache

+291 -45
+40 -4
.github/workflows/api.yml
··· 54 54 55 55 - name: Test Docker image 56 56 run: | 57 + # Check PostgreSQL is running 58 + echo "Checking PostgreSQL status..." 59 + docker ps | grep postgres-test 60 + docker logs postgres-test 61 + 62 + # Test PostgreSQL connection 63 + echo "Testing PostgreSQL connection..." 64 + docker exec postgres-test psql -U slice -d slice_test -c "SELECT version();" 65 + 57 66 # Start the Slice container with PostgreSQL backend 67 + echo "Starting Slice container..." 58 68 docker run -d --name slice-test -p 8080:8080 \ 59 69 -e HTTP_PORT=8080 \ 60 70 -e DATABASE_URL=postgresql://slice:slice_test_password@host.docker.internal:5432/slice_test \ 61 71 --add-host host.docker.internal:host-gateway \ 62 72 slice:latest 63 73 64 - # Wait for the service to start 65 - sleep 20 74 + # Wait for the service to start and show logs 75 + echo "Waiting for service to start..." 76 + sleep 10 77 + 78 + echo "Checking all containers (including exited)..." 79 + docker ps -a | grep -E "(slice-test|postgres-test)" || true 80 + 81 + echo "Checking Slice container status..." 82 + docker ps | grep slice-test || echo "Slice container not running!" 83 + 84 + echo "Slice container logs:" 85 + docker logs slice-test 2>&1 || echo "Failed to get logs" 86 + 87 + echo "Checking if slice container exited:" 88 + docker inspect slice-test --format='{{.State.Status}}' || echo "Container not found" 89 + docker inspect slice-test --format='{{.State.ExitCode}}' || echo "No exit code" 90 + 91 + # Additional wait 92 + sleep 10 93 + 94 + echo "Final Slice container logs:" 95 + docker logs slice-test 2>&1 || echo "Failed to get final logs" 66 96 67 - # Test the root endpoint 68 - curl -f http://localhost:8080 || exit 1 97 + # Test the root endpoint with verbose output 98 + echo "Testing root endpoint..." 99 + curl -v -f http://localhost:8080 || { 100 + echo "Curl failed, showing final logs:" 101 + docker logs slice-test 102 + docker logs postgres-test 103 + exit 1 104 + } 69 105 70 106 # Stop test containers 71 107 docker stop slice-test postgres-test
+42
api/.sqlx/query-036060c119df29bc03faafee79b3ec28245e8fd58422a750780cbc1e237d2ce5.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n SELECT did, handle, slice_uri, indexed_at\n FROM actor\n WHERE slice_uri = $1\n AND (handle ILIKE '%' || $2 || '%' OR did ILIKE '%' || $2 || '%')\n ORDER BY did ASC\n LIMIT $3\n ", 4 + "describe": { 5 + "columns": [ 6 + { 7 + "ordinal": 0, 8 + "name": "did", 9 + "type_info": "Text" 10 + }, 11 + { 12 + "ordinal": 1, 13 + "name": "handle", 14 + "type_info": "Text" 15 + }, 16 + { 17 + "ordinal": 2, 18 + "name": "slice_uri", 19 + "type_info": "Text" 20 + }, 21 + { 22 + "ordinal": 3, 23 + "name": "indexed_at", 24 + "type_info": "Text" 25 + } 26 + ], 27 + "parameters": { 28 + "Left": [ 29 + "Text", 30 + "Text", 31 + "Int8" 32 + ] 33 + }, 34 + "nullable": [ 35 + false, 36 + true, 37 + false, 38 + false 39 + ] 40 + }, 41 + "hash": "036060c119df29bc03faafee79b3ec28245e8fd58422a750780cbc1e237d2ce5" 42 + }
+17
api/.sqlx/query-0534a4ffc0309c583a4e9b1fe70f934f8724eb82077d2e5d246876ca8294a588.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "INSERT INTO \"actor\" (\"did\", \"handle\", \"slice_uri\", \"indexed_at\")\n VALUES ($1, $2, $3, $4)\n ON CONFLICT (\"did\", \"slice_uri\")\n DO UPDATE SET\n \"handle\" = EXCLUDED.\"handle\",\n \"indexed_at\" = EXCLUDED.\"indexed_at\"", 4 + "describe": { 5 + "columns": [], 6 + "parameters": { 7 + "Left": [ 8 + "Text", 9 + "Text", 10 + "Text", 11 + "Text" 12 + ] 13 + }, 14 + "nullable": [] 15 + }, 16 + "hash": "0534a4ffc0309c583a4e9b1fe70f934f8724eb82077d2e5d246876ca8294a588" 17 + }
-16
api/.sqlx/query-10240d7c664eb54bc66b1a7a09e93699abac351c9cbe92ace54efe396258ddf4.json
··· 1 - { 2 - "db_name": "PostgreSQL", 3 - "query": "INSERT INTO \"actor\" (\"did\", \"handle\", \"indexed_at\")\n VALUES ($1, $2, $3)\n ON CONFLICT (\"did\")\n DO UPDATE SET\n \"handle\" = EXCLUDED.\"handle\",\n \"indexed_at\" = EXCLUDED.\"indexed_at\"", 4 - "describe": { 5 - "columns": [], 6 - "parameters": { 7 - "Left": [ 8 - "Text", 9 - "Text", 10 - "Text" 11 - ] 12 - }, 13 - "nullable": [] 14 - }, 15 - "hash": "10240d7c664eb54bc66b1a7a09e93699abac351c9cbe92ace54efe396258ddf4" 16 - }
+41
api/.sqlx/query-151d1a942d80118cb4b117ba1e823d2027457838715ecb38247c3308046d8888.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n SELECT did, handle, slice_uri, indexed_at\n FROM actor\n WHERE slice_uri = $1\n ORDER BY did ASC\n LIMIT $2\n ", 4 + "describe": { 5 + "columns": [ 6 + { 7 + "ordinal": 0, 8 + "name": "did", 9 + "type_info": "Text" 10 + }, 11 + { 12 + "ordinal": 1, 13 + "name": "handle", 14 + "type_info": "Text" 15 + }, 16 + { 17 + "ordinal": 2, 18 + "name": "slice_uri", 19 + "type_info": "Text" 20 + }, 21 + { 22 + "ordinal": 3, 23 + "name": "indexed_at", 24 + "type_info": "Text" 25 + } 26 + ], 27 + "parameters": { 28 + "Left": [ 29 + "Text", 30 + "Int8" 31 + ] 32 + }, 33 + "nullable": [ 34 + false, 35 + true, 36 + false, 37 + false 38 + ] 39 + }, 40 + "hash": "151d1a942d80118cb4b117ba1e823d2027457838715ecb38247c3308046d8888" 41 + }
-22
api/.sqlx/query-18231fada9b346d6a03c634c99bb269deb1dfe67d96051af8b40f0d926d89e97.json
··· 1 - { 2 - "db_name": "PostgreSQL", 3 - "query": "\n WITH slice_collections AS (\n SELECT DISTINCT\n json->>'nsid' as collection_nsid\n FROM record\n WHERE collection = 'social.slices.lexicon'\n AND json->>'slice' = $1\n AND json->>'nsid' IS NOT NULL\n AND (json->>'definitions')::jsonb->'main'->>'type' = 'record'\n )\n SELECT COUNT(DISTINCT r.did) as count\n FROM record r\n INNER JOIN slice_collections sc ON r.collection = sc.collection_nsid\n ", 4 - "describe": { 5 - "columns": [ 6 - { 7 - "ordinal": 0, 8 - "name": "count", 9 - "type_info": "Int8" 10 - } 11 - ], 12 - "parameters": { 13 - "Left": [ 14 - "Text" 15 - ] 16 - }, 17 - "nullable": [ 18 - null 19 - ] 20 - }, 21 - "hash": "18231fada9b346d6a03c634c99bb269deb1dfe67d96051af8b40f0d926d89e97" 22 - }
+42
api/.sqlx/query-5f78504511b462b3199e82c23673d3409ac2b75fd574dafc80ad0fed4e1ef352.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n SELECT did, handle, slice_uri, indexed_at\n FROM actor\n WHERE slice_uri = $1 AND did > $2\n ORDER BY did ASC\n LIMIT $3\n ", 4 + "describe": { 5 + "columns": [ 6 + { 7 + "ordinal": 0, 8 + "name": "did", 9 + "type_info": "Text" 10 + }, 11 + { 12 + "ordinal": 1, 13 + "name": "handle", 14 + "type_info": "Text" 15 + }, 16 + { 17 + "ordinal": 2, 18 + "name": "slice_uri", 19 + "type_info": "Text" 20 + }, 21 + { 22 + "ordinal": 3, 23 + "name": "indexed_at", 24 + "type_info": "Text" 25 + } 26 + ], 27 + "parameters": { 28 + "Left": [ 29 + "Text", 30 + "Text", 31 + "Int8" 32 + ] 33 + }, 34 + "nullable": [ 35 + false, 36 + true, 37 + false, 38 + false 39 + ] 40 + }, 41 + "hash": "5f78504511b462b3199e82c23673d3409ac2b75fd574dafc80ad0fed4e1ef352" 42 + }
+41
api/.sqlx/query-a1e7a0e5eca60ac8e5612ee937ffee4396b06696cfcf23c666fc9c2e853bb2e4.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n SELECT did, handle, slice_uri, indexed_at\n FROM actor\n WHERE slice_uri = $1 AND did = ANY($2)\n ORDER BY did ASC\n ", 4 + "describe": { 5 + "columns": [ 6 + { 7 + "ordinal": 0, 8 + "name": "did", 9 + "type_info": "Text" 10 + }, 11 + { 12 + "ordinal": 1, 13 + "name": "handle", 14 + "type_info": "Text" 15 + }, 16 + { 17 + "ordinal": 2, 18 + "name": "slice_uri", 19 + "type_info": "Text" 20 + }, 21 + { 22 + "ordinal": 3, 23 + "name": "indexed_at", 24 + "type_info": "Text" 25 + } 26 + ], 27 + "parameters": { 28 + "Left": [ 29 + "Text", 30 + "TextArray" 31 + ] 32 + }, 33 + "nullable": [ 34 + false, 35 + true, 36 + false, 37 + false 38 + ] 39 + }, 40 + "hash": "a1e7a0e5eca60ac8e5612ee937ffee4396b06696cfcf23c666fc9c2e853bb2e4" 41 + }
+43
api/.sqlx/query-b58de114ce08559fd7799ee15fe0934fe48b892c35caaa63c09221234a989dd6.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n SELECT did, handle, slice_uri, indexed_at\n FROM actor\n WHERE slice_uri = $1\n AND (handle ILIKE '%' || $2 || '%' OR did ILIKE '%' || $2 || '%')\n AND did > $3\n ORDER BY did ASC\n LIMIT $4\n ", 4 + "describe": { 5 + "columns": [ 6 + { 7 + "ordinal": 0, 8 + "name": "did", 9 + "type_info": "Text" 10 + }, 11 + { 12 + "ordinal": 1, 13 + "name": "handle", 14 + "type_info": "Text" 15 + }, 16 + { 17 + "ordinal": 2, 18 + "name": "slice_uri", 19 + "type_info": "Text" 20 + }, 21 + { 22 + "ordinal": 3, 23 + "name": "indexed_at", 24 + "type_info": "Text" 25 + } 26 + ], 27 + "parameters": { 28 + "Left": [ 29 + "Text", 30 + "Text", 31 + "Text", 32 + "Int8" 33 + ] 34 + }, 35 + "nullable": [ 36 + false, 37 + true, 38 + false, 39 + false 40 + ] 41 + }, 42 + "hash": "b58de114ce08559fd7799ee15fe0934fe48b892c35caaa63c09221234a989dd6" 43 + }
+3 -3
api/.sqlx/query-f27e3144fed041f67b17cafe33071a9648e838d0d0b7cc8078d4812b0edb68ff.json api/.sqlx/query-678473ff73728b115ac4a310bc477f3ccd6763594a894809a6769704e3b55701.json
··· 1 1 { 2 2 "db_name": "PostgreSQL", 3 - "query": "\n SELECT uri, cid, did, collection, json, \"indexed_at\" as indexed_at\n FROM record\n WHERE collection = $1 AND json->>'slice' = $2 AND \"indexed_at\" < $3 AND did = $4\n ORDER BY \"indexed_at\" DESC\n LIMIT $5\n ", 3 + "query": "\n SELECT uri, cid, did, collection, json, \"indexed_at\" as indexed_at\n FROM record\n WHERE collection = $1 AND json->>'slice' = $2 AND \"indexed_at\" < $3 AND did = ANY($4)\n ORDER BY \"indexed_at\" DESC\n LIMIT $5\n ", 4 4 "describe": { 5 5 "columns": [ 6 6 { ··· 39 39 "Text", 40 40 "Text", 41 41 "Timestamptz", 42 - "Text", 42 + "TextArray", 43 43 "Int8" 44 44 ] 45 45 }, ··· 52 52 false 53 53 ] 54 54 }, 55 - "hash": "f27e3144fed041f67b17cafe33071a9648e838d0d0b7cc8078d4812b0edb68ff" 55 + "hash": "678473ff73728b115ac4a310bc477f3ccd6763594a894809a6769704e3b55701" 56 56 }
+22
api/.sqlx/query-fbe19e14541c9cf58b013c228d1b55b62d9c82fa96e0ea7390a2bd570694e521.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n SELECT COUNT(*) as count\n FROM actor\n WHERE slice_uri = $1\n ", 4 + "describe": { 5 + "columns": [ 6 + { 7 + "ordinal": 0, 8 + "name": "count", 9 + "type_info": "Int8" 10 + } 11 + ], 12 + "parameters": { 13 + "Left": [ 14 + "Text" 15 + ] 16 + }, 17 + "nullable": [ 18 + null 19 + ] 20 + }, 21 + "hash": "fbe19e14541c9cf58b013c228d1b55b62d9c82fa96e0ea7390a2bd570694e521" 22 + }