Skip to content

Commit

Permalink
Add TagManager APIs for Root Product Id
Browse files Browse the repository at this point in the history
Summary:
* Implement getter and setter for new field root_product_id from contextprop baggage in TagManager
* As part of setter, log override event in ```TagManagerTracingEventLogger```

Differential Revision: D70340893

fbshipit-source-id: 139396c950d69739fc5ec24d6af0920bb4fe3432
  • Loading branch information
Pratik Gajanan Parashar authored and facebook-github-bot committed Mar 5, 2025
1 parent 5bb0897 commit a86770f
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,15 @@ public function clearBaggageFlags1ByName(
}

// Getters for the root_product_id
public function getRootProductId()[leak_safe]: ?int {
return $this->storage->baggage?->root_product_id;
public readonly function getRootProductId()[leak_safe]: ?int {
if ($this->storage->baggage is null) {
return null;
}
$root_product_id = $this->storage->baggage?->root_product_id;
if ($root_product_id is null) {
return null;
}
return ($root_product_id as int);
}

// Immutable setter for the root_product_id
Expand Down

0 comments on commit a86770f

Please sign in to comment.