Skip to content

Instantly share code, notes, and snippets.

View johnnyji's full-sized avatar
🏠
Working from home

Johnny Ji johnnyji

🏠
Working from home
View GitHub Profile
@johnnyji
johnnyji / string_replacer.js
Last active November 9, 2019 18:20
String Replacer
// Write a function that will take a string with word placeholders (ie. "Hello __NAME__"), and an
// options object (ie. {name: "James"})and return that string with placeholder words replaced by values
// in the options object (ie. "Hello James")
// For this example, we can assume that each __PLACEHOLDER__ in the string will have a corresponding key in the options object.
// So the word `__PLACEHOLDER__` in the string will have a key value of `placeholder` in the options object. Let's look
// at a quick example:
// const string = "James loves to play __SPORT__ on __DAYOFWEEK__"
// const opts = {sport: "soccer", dayOfWeek: "Sunday"};

Issue

Some users in Distru have not had their transfers cache updated since 06/28/2022. An example of this is this Asana ticket.

Data

Impersonate user: [email protected] Order ID not syncing: 495908

Investigation

Company had LL order not created in Distru

SELECT leaflink_order_cache_updated_up_until FROM companies WHERE id = 298490;

This tells me that the company's last updated time for the LL order sync was July 28th

SELECT leaflink_id, jsonb_pretty(payload) FROM leaflink_order_caches loc WHERE loc.payload ->>'short_id'='8a5cca4213a' AND archived_at IS NULL;

User from Company ID: 197968 is not seeing test results auto-populated, despite package saying "TestPassed" on June 13th, package was imported in Distru on July 17th

SELECT metrc_id FROM packages WHERE id = 2713720;

 metrc_id
----------
  6543105
(1 row)

Issue

https://app.asana.com/0/1161712892239265/1202764423803060

Customer is saying that Distru update their LL product quantity to zero and listing status to unavailable, even though there is quantity in Distru.

Investigating

Let's take one of the products mentioned in the ticket "Pharmicated - Pre-Rolls (Flower) - Alien OG - 1g" (ID: 620527) and look at what LL product it's associated to: