Kaiteki icon indicating copy to clipboard operation
Kaiteki copied to clipboard

Unable to load timeline due to multiple post authors in json: Scheme not starting with alphabetic character at offset 0.

Open drannex42 opened this issue 1 year ago • 3 comments

Error Type

CheckedFromJsonException

Error Message

CheckedFromJsonExceptionCould not create PreviewCard.There is a problem with "author_url".Scheme not starting with alphabetic character at offset 0.

Stack Trace

#0      $checkedConvert (package:json_annotation/src/checked_helpers.dart:91)
#1      $checkedCreate.checkedConvert (package:json_annotation/src/checked_helpers.dart:28)
#2      _$PreviewCardFromJson.<anonymous closure> (package:fediverse_objects/src/mastodon/preview_card.g.dart:20)
#3      $checkedCreate.<anonymous closure> (package:json_annotation/src/checked_helpers.dart:33)
#4      $checkedNew (package:json_annotation/src/checked_helpers.dart:51)
#5      $checkedCreate (package:json_annotation/src/checked_helpers.dart:30)
#6      _$PreviewCardFromJson (package:fediverse_objects/src/mastodon/preview_card.g.dart:9)
#7      new PreviewCard.fromJson (package:fediverse_objects/src/mastodon/preview_card.dart:75)
#8      _$StatusFromJson.<anonymous closure>.<anonymous closure> (package:fediverse_objects/src/mastodon/status.g.dart:57)
#9      $checkedConvert (package:json_annotation/src/checked_helpers.dart:87)
#10     $checkedCreate.checkedConvert (package:json_annotation/src/checked_helpers.dart:28)
#11     _$StatusFromJson.<anonymous closure> (package:fediverse_objects/src/mastodon/status.g.dart:53)
#12     $checkedCreate.<anonymous closure> (package:json_annotation/src/checked_helpers.dart:33)
#13     $checkedNew (package:json_annotation/src/checked_helpers.dart:51)
#14     $checkedCreate (package:json_annotation/src/checked_helpers.dart:30)
#15     _$StatusFromJson (package:fediverse_objects/src/mastodon/status.g.dart:9)
#16     new Status.fromJson (package:fediverse_objects/src/mastodon/status.dart:155)
#17     MappedIterable.elementAt (dart:_internal/iterable.dart:385)
#18     ListIterator.moveNext (dart:_internal/iterable.dart:354)
#19     new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189)
#20     new _GrowableList.of (dart:core-patch/growable_array.dart:150)
#21     new List.of (dart:core-patch/array_patch.dart:39)
#22     SetBase.toList (dart:collection/set.dart:119)
#23     KaitekiResponseExtensions.fromJsonList (package:kaiteki_core/src/http/extensions.dart:22)
#24     KaitekiJsonDeserializationResopnseExtensions.fromResponseList (package:kaiteki_core/src/http/extensions.dart:29)
#25     KaitekiJsonDeserializationResopnseExtensions.fromResponseList.<anonymous closure> (package:kaiteki_core/src/http/extensions.dart:29)
<asynchronous suspension>
#26     SharedMastodonAdapter.getTimeline (package:kaiteki_core/src/social/backends/mastodon/shared_adapter.dart:233)
<asynchronous suspension>
#27     TimelineService.build (package:kaiteki/fediverse/services/timeline.dart:66)
<asynchronous suspension>
#28     FutureHandlerProviderElementMixin.handleFuture.<anonymous closure>.<anonymous closure> (package:riverpod/src/async_notifier/base.dart:339)
<asynchronous suspension>

Additional information

Platform: Android (KB2005_11_F.13) Version: Weekly 2023-42.1 (1697502963)

drannex42 avatar Oct 21 '23 18:10 drannex42

The JSON for the post that appears to be causing the issue:

{
  "url": "https://www.rockpapershotgun.com/final-fantasy-14s-fall-guys-minigame-looks-like-wonderful-chaos-and-well-be-able-to-play-it-this-month",
  "title": "Final Fantasy 14’s Fall Guys minigame looks like wonderful chaos, and we’ll be able to play it this month",
  "description": "While FF14 costumes make their way into the multiplayer party game.",
  "language": "en",
  "type": "link",
  "author_name": "Matt Jarvis",
  "author_url": "[\"https://www.rockpapershotgun.com/authors/matt-jarvis\", \"https://twitter.com/liquidmatt\"]",
  "provider_name": "Rock Paper Shotgun",
  "provider_url": "",
  "html": "",
  "width": 1200,
  "height": 630,
  "image": "https://media.infosec.exchange/infosec.exchange/cache/preview_cards/images/015/811/781/original/61ff795373905bef.png",
  "image_description": "",
  "embed_url": "",
  "blurhash": "UJG^a-@rPmPS~TQ]MyI;7#OsVYR6E%%Cn4X*",
  "published_at": "2023-10-21T16:10:18.534Z"
}

Appears to me that the templating system is unable to handle multiple post authors in the author_url block.

drannex42 avatar Oct 21 '23 18:10 drannex42

Appears to me that the templating system

We aren't using any templating system.

unable to handle multiple post authors in the author_url block

I don't know what instance/backend you're using, but this API response is off-spec: https://docs.joinmastodon.org/entities/PreviewCard/#author_url

Dart throwing this format error seems to be very well correct.

Craftplacer avatar Oct 22 '23 08:10 Craftplacer

Assuming you're on infosec.exchange, looking at Glitch-soc's source code, this seems very well to be a bug with what they provide/store as URL.

Craftplacer avatar Oct 22 '23 08:10 Craftplacer