added fileFetchedAt to TickerPageResponse and updated the Ticker UI to use it as the data currency timestamp for proxied files

This commit is contained in:
2026-07-13 00:32:27 +02:00
parent 2f5a6b4ce0
commit 15791423ea
3 changed files with 12 additions and 1 deletions
@@ -44,6 +44,12 @@ class TickerPageResponse {
/// when the page has never been published. /// when the page has never been published.
final String? publishedAt; final String? publishedAt;
/// PROXIED_FILE only: ISO timestamp of the last successful re-fetch of the
/// file by the server proxy (`ticker_pages.proxy_last_success_at`) — the
/// document's data currency, shown as "Aktualisiert am …" instead of
/// [publishedAt]. Null for other kinds / files never fetched yet.
final String? fileFetchedAt;
TickerPageResponse({ TickerPageResponse({
required this.schemaVersion, required this.schemaVersion,
this.slug, this.slug,
@@ -58,6 +64,7 @@ class TickerPageResponse {
this.hash, this.hash,
this.webUrl, this.webUrl,
this.publishedAt, this.publishedAt,
this.fileFetchedAt,
}); });
factory TickerPageResponse.fromJson(Map<String, dynamic> json) => factory TickerPageResponse.fromJson(Map<String, dynamic> json) =>
@@ -21,6 +21,7 @@ TickerPageResponse _$TickerPageResponseFromJson(Map<String, dynamic> json) =>
hash: json['hash'] as String?, hash: json['hash'] as String?,
webUrl: json['webUrl'] as String?, webUrl: json['webUrl'] as String?,
publishedAt: json['publishedAt'] as String?, publishedAt: json['publishedAt'] as String?,
fileFetchedAt: json['fileFetchedAt'] as String?,
); );
Map<String, dynamic> _$TickerPageResponseToJson(TickerPageResponse instance) => Map<String, dynamic> _$TickerPageResponseToJson(TickerPageResponse instance) =>
@@ -38,4 +39,5 @@ Map<String, dynamic> _$TickerPageResponseToJson(TickerPageResponse instance) =>
'hash': instance.hash, 'hash': instance.hash,
'webUrl': instance.webUrl, 'webUrl': instance.webUrl,
'publishedAt': instance.publishedAt, 'publishedAt': instance.publishedAt,
'fileFetchedAt': instance.fileFetchedAt,
}; };
@@ -94,7 +94,9 @@ class _TickerPageContentState extends State<_TickerPageContent> {
case TickerPageKind.proxiedFile: case TickerPageKind.proxiedFile:
return Column( return Column(
children: [ children: [
TickerUpdatedBar(publishedAt: page.publishedAt), // For proxied files the data currency is the last successful
// proxy fetch, not the page's publish date.
TickerUpdatedBar(publishedAt: page.fileFetchedAt ?? page.publishedAt),
Expanded( Expanded(
child: _ProxiedFileView( child: _ProxiedFileView(
repo: context.read<TickerPageBloc>().repo, repo: context.read<TickerPageBloc>().repo,