Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 06 23:02
    dnfadmin commented #2149
  • Jul 06 23:02
    dnfadmin commented #2149
  • Jul 06 22:58
    toanxyz closed #2192
  • Jul 06 22:58
    toanxyz closed #2192
  • Jul 06 20:35

    jeremydmiller on master

    new, improved, separate store a… (compare)

  • Jul 06 20:35

    jeremydmiller on master

    new, improved, separate store a… (compare)

  • Jul 06 20:35
    jeremydmiller closed #2288
  • Jul 06 20:35
    jeremydmiller closed #2288
  • Jul 06 20:35

    jeremydmiller on projections-cli

    (compare)

  • Jul 06 20:35

    jeremydmiller on projections-cli

    (compare)

  • Jul 06 20:35
    jeremydmiller closed #2266
  • Jul 06 20:35
    jeremydmiller closed #2266
  • Jul 06 20:11
    jeremydmiller opened #2288
  • Jul 06 20:11
    jeremydmiller opened #2288
  • Jul 06 20:10

    jeremydmiller on projections-cli

    new, improved, separate store a… (compare)

  • Jul 06 20:10

    jeremydmiller on projections-cli

    new, improved, separate store a… (compare)

  • Jul 05 13:26

    jeremydmiller on master

    Improving sample and adding rea… (compare)

  • Jul 05 13:26
    jeremydmiller closed #736
  • Jul 05 13:15
    jeremydmiller milestoned #2211
  • Jul 05 13:15
    jeremydmiller milestoned #2211
Oskar Dudycz
@oskardudycz
But sometimes it happens
so there might be various solutions for that
Tony Karalis
@tonykaralis
I hear you
Oskar Dudycz
@oskardudycz
  1. The easiest is to publish prerelease package with the breaking change so the package clients might be prepared and then when all confirm that they have the code prepared then release the package.
  1. Longer, but better. Send at first non-breaking change so the new payload together with the old one and try to handle both. You mark also old one as obsolete. Then you can have "contract" with the clients of your package (especially if they're other teams in your company) that they have eg. 2-4 weeks to adapt, then you'll remove the old payload.
at least that's the scenarios that I'd suggest
Tony Karalis
@tonykaralis
Thank you Oscar, i think I like this one the most >I think that it's safer and in the long term faster to not make breaking changes
Oskar Dudycz
@oskardudycz
Plus it's always good to provide some explanation or migration guide if this is the breaking change
In Marten, we're also trying to avoid breaking changes as much as we can
Tony Karalis
@tonykaralis
I have noticed, trust me its much appreciated.
Oskar Dudycz
@oskardudycz
There is third option, so you provide new implementation as the feature toggle that someone might turn on or of
so eg. class in the new namespace
and then also give some time for users to adapt
But it's more for the contract changes in eg. Rest or events
probably for the packages it won't be super effective, but it's also an option
Then after some time you just remove the old code and remove this feature toggle
Tony Karalis
@tonykaralis
I had never thought of using a different namespace that way, nice one ;)
Oskar Dudycz
@oskardudycz
:+1:
Tony Karalis
@tonykaralis
Just thought of a quick and dirty way of checking the schemas. What if we used a bit of reflection and stored a list of property names and types, then just did a check for any missing properties(which would imply a delete/rename) or any type changes.
We could then register all the classes we want to check (I don't need everything validated, only the ones in the external core library)
Might be a dud, whats your first impression?
Oskar Dudycz
@oskardudycz
That's also an option, but you'd also need to store imho types of properties
as it might also impact deserialization
That'd be similar approach as I suggested with the json schema, but with custom schema format
If it's enough then it's fine, it's usually good to keep the things simple, although in the long term json schema would be imho easier to maintain (as it's common format)
You can also store some sample jsons
and then write the tests to verify if they deserialize properly
Tony Karalis
@tonykaralis
Yes absolutely. If I went down the full blown Json Schema checking route, then I would attempt to come up with a PR for Marten not just for myself.
Oskar Dudycz
@oskardudycz
with the set conditions (eg. all properties are non-default)
Tony Karalis
@tonykaralis
Oscar, you are just full of ideas this morning :D
Oskar Dudycz
@oskardudycz
@tonykaralis we would be grateful for that :)
huh, I usually have too many ideas :P
It would be nice to have in Marten possibility to store json schemas of the documents/events
and then allow user to have opt in to check the schema during storing, appending
or as you said validation
But it's quite some work to provide full-fledged solution
I think that it'd be cool feature
Tony Karalis
@tonykaralis
Yeah, i can see all sorts of issues wed need to deal with
Right so I have 2 things to do then, 1st I need to write a quick fix to protect us in the interim. 2nd I am going to try and get the company to allow some time for this, perhaps myself and one of my devs can work on this. Its a long shot but you never know.
Oskar Dudycz
@oskardudycz
:+1:
seems legit :)
Tony Karalis
@tonykaralis
Thanks for your time @oskardudycz
Oskar Dudycz
@oskardudycz
You're welcome, I'm glad that I was able to help :)
ddivita
@ddivita

I need some guidance on searching collections in documents. I have this query:

'var license = "12345"'
'Session.Query<Organization>(o => o.AvailableLicenses.Select(a => a.License).Contains(license))'

I get the error : Marten does not (yet) support this Linq query type

should I change this to: Session.Query<Organization>(o => o.AvailableLicenses.Any(a => a.License == license))?

Oskar Dudycz
@oskardudycz
yes, I'd recommend that
it shouldwork
Even thinking outside marten Any should generate better queries than Select.Contains
as underneath it should translate it to exists (although that's theory of course ;) )
ddivita
@ddivita
Yep, that worked. Thanks @oskardudycz
Oskar Dudycz
@oskardudycz
:+1: