What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

How do people deal, in general, with inconsistent data in Yves?

2

Comments

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020

    it's not in abstract storage in the DB

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    but the abstract product exists

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020

    I'd think event:trigger -rproduct_abstract -i2086 (where 2086 is the abstract product) should solve it?

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    there could be scenarios when it got disabled and removed from storage, but concretes were not taken care of

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    all the concretes seem active

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    yes it might solve it (if product is valid). But the question is why could that happen

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    it doesn't populate the storage table after that

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    maybe my pub/sync knowledge is lacking though

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    there can be many reasons for this, but my first guess is that you have errors while publishing something

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    or if you have super slow queue processing and until messages are processed you have inconsistent state

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    I should probably prepare a talk on p&s troubleshooting

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    yeah -- would be a good talk πŸ™‚

  • Ehsan Zanjani
    Ehsan Zanjani Head of Solution Architecture @ Spryker Posts: 113 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hi @UKGT7RC7P,
    Good to hear from you! πŸ™‚
    Yves data consistency for each resource is defined in each storage client as a default logic. if the data is not completed in Redis, you probably get an exception. and project needs to handle this either 404 page or custom logic which defined based on project

  • Ehsan Zanjani
    Ehsan Zanjani Head of Solution Architecture @ Spryker Posts: 113 πŸ§‘πŸ»β€πŸš€ - Cadet

    btw Data consistency can be different or several projects. e.g. Products can be shown even if price is not there, or image is missing

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    thanks πŸ™‚ would be good to have some kind of validation in the FE though, as otherwise you would just have to catch all errors and make them 404s

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    if you had validation you could verify the data asynchronously

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    and deactivate problematic products f.e.

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    πŸ€”

  • Ehsan Zanjani
    Ehsan Zanjani Head of Solution Architecture @ Spryker Posts: 113 πŸ§‘πŸ»β€πŸš€ - Cadet

    Let me check this

  • Ehsan Zanjani
    Ehsan Zanjani Head of Solution Architecture @ Spryker Posts: 113 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020

    As I said the validation could be different for project implementation, Page can be still rendered with optional missing data, but with mandatory missing data, exception is fine, you don’t need to catch all errors, only those you think it’s mandatory for showing a product which should not be too many.

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    yeah, the problem really is that the NULL errors are not handled in Spryker

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    so you just get call to method on NULL, undefined index etc

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020

    so I would want to extend the all Spryker things and add some exception handling where anything could be NULL / undefined

  • Unknown
    edited May 2020

    do you have to handle it before it hits the template?

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    there are lots of places where it's assumed that the data is not null

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    but it can be

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    it can happen in the template, or in the storage client, or anywhere in between

  • do you have a couple of examples at hand?

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    vendor/spryker/product-storage/src/Spryker/Client/ProductStorage/Storage/ProductAbstractStorageReader.php:363

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    but there are numerous places