Closed n1k0 closed 6 years ago
Ideally we should abstract all the id fields so they have their own type, eg.
type StatusId = StatusId String
Reasoning being, as per rtfeldman's example SPA:
Identifiers such as
CommentId
,Username
, andSlug
- which are used to uniquely identify comments, users, and articles, respectively - are implemented as union types. If we used e.g.type alias Username = String
, we could mistakenly pass aUsername
to an API call expecting aSlug
, and it would still compile. We can rule bugs like that out by implementing identifiers as union types.
That's a bunch of code to update and I'm kinda lazy these days, so any help doing so would be greatly appreciated.
That's a bunch of code to update and I'm kinda lazy these days, so any help doing so would be greatly appreciated.
n1k0 seems like a good candidate for hacktoberfest 🍺
Ah, I know nothing about it and just spent all my available amount of time dedicated to do something other than enjoying my weekend, would you mind taking care of that? :)
If anyone is interested into contributing, I've migrated the Status
record type to use a specific type for status ids in https://github.com/n1k0/tooty/pull/197/commits/418bac1bb05695412585434911cf51dd4e811f16.
We should do the same for Account
, Media
and every other entity having a string id.
Thanks for giving it a look so quickly, and sorry to undermine your weekend! When I try this PR, npm install and package and npm start, I run into the following error when accessing /
:
Trying to initialize the `Main` module with an unexpected flag.
I tried to convert it to an Elm value, but ran into this problem:
Expecting a String at _.clients but instead got: null
Is there something I am doing wrong?
@bnjbvr Can you please update and check again? Thanks!
Works like a charm, thank you so much!
Things should be working entirely now, I've deployed this branch to production at https://n1k0.github.io/tooty/
Feedback would be much appreciated!
Works like a charm, thank you very much!
Salut !
Things should be working entirely now, I've deployed this branch to production at https://n1k0.github.io/tooty/
Feedback would be much appreciated!
Great !
Just DL gh-pages.zip, updated and... it works again :-)
Thanks !!!
--
Cordialement
**Christophe ANTOINE
**site internet : cabinet-antoine.fr
This is an attempt at fixing breaking changes with the Mastodon API v2.0.0 (#196), notably those where the unique ids are now strings instead of ints.
The fix ensures previous Mastodon server versions are still working properly.
Users are invited to test this patch locally and give their feedback on this issue if anything is broken or missing.