Giter Club home page Giter Club logo

Comments (4)

max2pt0 avatar max2pt0 commented on July 23, 2024 2

I can only speak in general terms as someone trying to learn ATProto who is using your library as a tool to do this and hasn't yet released anything but may do so shortly.

Since ATProto is still evolving I need the tool to evolve with it. I don't consider anything I write to be something that can be forgotten and expected to work if ATProto changes. Any process that can be done to gracefully manage changes so there is less breakage would be great but not too much at the expense of your time as the developer of the library. If I have to code extra steps now to facilitate this process and know there will eventually be a one time change (?) when ATProto is finalized that's fine by me.

from atproto.

MarshalX avatar MarshalX commented on July 23, 2024

new note. if we allow extra fields it will not help to detect such bugs of bsky #205. probably that's why this bug wasn't reported because they ignore "detailed" fields. and our SDK helps the third time to bsky team to fix bugs related to lexicon

from atproto.

MarshalX avatar MarshalX commented on July 23, 2024

Lexicons are allowed to change over time, within some bounds to ensure both forwards and backwards compatibility. The basic principle is that all old data must still be valid under the updated Lexicon, and new data must be valid under the old Lexicon.

  • Any new fields must be optional
  • Non-optional fields can not be removed.
  • Types can not change
  • Fields can not be renamed

From here: https://atproto.com/specs/lexicon#lexicon-evolution

the first item confirms that we should make extra fields optional; the other 3 items confirm that other strict checks must be still enabled

from atproto.

MarshalX avatar MarshalX commented on July 23, 2024

Okay, I decided to do it. #207 brings:

  • Allowing additional fields with access to it
  • Warn on found additional field(s) with explanation why it could happen
  • Ability to disable warn via env var (for now, maybe in the code later)
  • Unit tests that cover lexicon evolution from official docs. tests
  • DotDict is only for unknown record types now

what is not included: access to extra fields using snake case (protocol uses camelCase)

upd. warns have been disabled because it gives false positives due to the way pydantic works

from atproto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.