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..

Quick question - we're looking at upgrading our Wishlist Rest API module to 1.6.0 from 1.4.3 and we'

Options
U017Y69D9U4
U017Y69D9U4 Posts: 34 🧑🏻‍🚀 - Cadet
edited February 2022 in Help

Quick question - we're looking at upgrading our Wishlist Rest API module to 1.6.0 from 1.4.3 and we've noticed that in the src/Spryker/Zed/WishlistsRestApi/Business/WishlistItem/WishlistItemDeleter.php on line 53 we're requiring the UUID of a Wishlist item - but wishlist items don't seem to have a UUID.

I believe previously this was checking whether a SKU had been provided which seems correct. Just wondering if this is a bug (I don't see any table schema changes related to this in this diff - https://github.com/spryker/wishlists-rest-api/compare/1.4.3...1.6.0 that would add a UUID column to the spy_wishlist_item table)?

Comments

  • U01A5ARAXP0
    U01A5ARAXP0 Posts: 119 🧑🏻‍🚀 - Cadet
    Options

    It seems the Uuid it was already in that earlier version. There is a console command (WishlistsUuidWriterConsole.php) which will generate and add uuid where missing

  • U017Y69D9U4
    U017Y69D9U4 Posts: 34 🧑🏻‍🚀 - Cadet
    Options

    That command is deprecated in favour of using UuidGeneratorConsole which when run against that table returns an error to say there is no field in the table for UUID? 🤔

  • U017Y69D9U4
    U017Y69D9U4 Posts: 34 🧑🏻‍🚀 - Cadet
    Options

    (exact message - Table spy_wishlist_item does not contain uuid field )

  • U02V3L4CKD4
    U02V3L4CKD4 Posts: 7 🧑🏻‍🚀 - Cadet
    Options

    Perhaps there’s a missing schema change in the Wishlist module (for context i’m working with @U017Y69D9U4 😅)

  • U01A5ARAXP0
    U01A5ARAXP0 Posts: 119 🧑🏻‍🚀 - Cadet
    Options

    the uuid behavior is added to the spy_wishlist table, not the spy_wishlist_item table

  • U017Y69D9U4
    U017Y69D9U4 Posts: 34 🧑🏻‍🚀 - Cadet
    edited February 2022
    Options

    Yes that's correct - but in WishlistItemDeleter in the latest version Spryker seems to be checking for a UUID on the wishlist item

  • U02V3L4CKD4
    U02V3L4CKD4 Posts: 7 🧑🏻‍🚀 - Cadet
    Options

    src/Spryker/Zed/WishlistsRestApi/Business/WishlistItem/WishlistItemDeleter.php:53

  • U017Y69D9U4
    U017Y69D9U4 Posts: 34 🧑🏻‍🚀 - Cadet
    Options
    $wishlistItemRequestTransfer->requireIdCustomer()
                ->requireUuidWishlist()
                ->requireUuid();
    
  • U017Y69D9U4
    U017Y69D9U4 Posts: 34 🧑🏻‍🚀 - Cadet
    Options

    Whereas in the previous version of this module, it was:

    $wishlistItemRequestTransfer->requireIdCustomer()
                ->requireUuidWishlist()
                ->requireSku();
    
  • U017Y69D9U4
    U017Y69D9U4 Posts: 34 🧑🏻‍🚀 - Cadet
    Options
  • U01A5ARAXP0
    U01A5ARAXP0 Posts: 119 🧑🏻‍🚀 - Cadet
    Options

    Yes, that seems a bug then

  • U017Y69D9U4
    U017Y69D9U4 Posts: 34 🧑🏻‍🚀 - Cadet
    Options

    Cool, I'll submit a bug report 👍

  • U017Y69D9U4
    U017Y69D9U4 Posts: 34 🧑🏻‍🚀 - Cadet
    Options

    Which might lead me to the next question - this seems to have changed since I last raised a bug report - where do I now need to go to raise a bug ticket? 😄

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    Options

    @UQKSAARKN can you confirm please if this is really an issue?

  • U017Y69D9U4
    U017Y69D9U4 Posts: 34 🧑🏻‍🚀 - Cadet
    Options

    It looks like it was this commit which introduced it (at least on the transfer object):

    https://github.com/spryker/wishlists-rest-api/commit/08743e00c118aba94334a05b4d678f55da385f69

    And instead of using a UUID, we're just setting a SKU string into it

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    Options

    Yep, wanted to ask @U0140NZMDTN as well but he looks like offline.

  • Dmitriy Aseev
    Dmitriy Aseev Senior PHP Developer @ Spryker Sprykee Posts: 20 🧑🏻‍🚀 - Cadet
    Options

    Hey, Guys!
    It's not real UUID, it is identifier (for wishlist item = SKU)
    Check GLUE layer: \Spryker\Glue\WishlistsRestApi\Processor\WishlistItems\WishlistItemDeleter::createWishlistItemRequest

    $wishlistUuid = $resource->getId();
    
    return (new WishlistItemRequestTransfer())
         ->setUuid($idResource)
         ->setUuidWishlist($wishlistUuid)
         ->setIdCustomer($surrogateIdentifier);
    
  • U017Y69D9U4
    U017Y69D9U4 Posts: 34 🧑🏻‍🚀 - Cadet
    Options

    Isn't that a bit misleading? Wouldn't it read better as SKU which is what is expected, rather than a UUID?

  • Dmitriy Aseev
    Dmitriy Aseev Senior PHP Developer @ Spryker Sprykee Posts: 20 🧑🏻‍🚀 - Cadet
    Options

    Yes, I totally agreed, but we have to support some related features (and SKU can't be unique reference):
    • In Product Offer feature we concatenate SKU+offer-reference and set it to UUID
    • In Configurable product feature we concatenate SKU+configurable_product_hash and set it to UUID
    But for other cases (concrete products) - we set SKU to UUID

  • U017Y69D9U4
    U017Y69D9U4 Posts: 34 🧑🏻‍🚀 - Cadet
    Options

    Seems then that we are therefore mis-using the term UUID elsewhere - perhaps a field called uniqueIdentifier would be better than UUID ? 🙂

  • Dmitriy Aseev
    Dmitriy Aseev Senior PHP Developer @ Spryker Sprykee Posts: 20 🧑🏻‍🚀 - Cadet
    Options

    Yes, you are right 👍
    But for now, we couldn't rename it in order to keep BC