Skip to content

Commit 49fbee2

Browse files
Fix remote asset list not showing newly uploaded images (#156)
After upload, assets were not yet in the manifest-backed list. This change: - Add manifest revision (hash of URLs) to the list API so the client can detect updates - After upload, poll until uploaded URLs appear in the manifest instead of a single re-fetch - Show processing state and optional "refresh available" prompt; support background sync on focus/visibility - Move upload/processing messages to YAML translations (i18n) Closes #86.
1 parent 09cf9b6 commit 49fbee2

File tree

6 files changed

+781
-24
lines changed

6 files changed

+781
-24
lines changed

src/RemoteContentAssets/Presentation/Controller/RemoteAssetsController.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ public function list(string $projectId): JsonResponse
6868
$project->remoteContentAssetsManifestUrls
6969
);
7070

71-
return $this->json(['urls' => $urls]);
71+
return $this->json([
72+
'urls' => $urls,
73+
'revision' => $this->buildUrlsRevision($urls),
74+
]);
7275
}
7376

7477
/**
@@ -164,4 +167,14 @@ public function upload(string $projectId, Request $request): JsonResponse
164167
return $this->json(['error' => 'Upload failed: ' . $e->getMessage()], Response::HTTP_INTERNAL_SERVER_ERROR);
165168
}
166169
}
170+
171+
/**
172+
* @param list<string> $urls
173+
*/
174+
private function buildUrlsRevision(array $urls): string
175+
{
176+
sort($urls, SORT_STRING);
177+
178+
return hash('sha256', implode("\n", $urls));
179+
}
167180
}

0 commit comments

Comments
 (0)