Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(egressRecord): Remove unnecessary multiplication for ts conversion #1588

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

fforbeck
Copy link
Member

Context

This PR fixes the handling of the servedAt timestamp in the packages/upload-api/src/space/record.js file.

The previous implementation included a multiplication by 1000, assuming a conversion from seconds to milliseconds was necessary. This change removes the conversion.

@fforbeck fforbeck merged commit b7bc90e into main Nov 22, 2024
4 checks passed
@fforbeck fforbeck deleted the fix/egress-record branch November 22, 2024 20:31
fforbeck pushed a commit that referenced this pull request Nov 25, 2024
🤖 I have created a release *beep* *boop*
---


##
[18.1.3](upload-api-v18.1.2...upload-api-v18.1.3)
(2024-11-22)


### Fixes

* **egressRecord:** Remove unnecessary multiplication for ts conversion
([#1588](#1588))
([b7bc90e](b7bc90e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
fforbeck added a commit to storacha/w3infra that referenced this pull request Nov 25, 2024
**Context**
I've identified an issue in our DynamoDB table where egress events were
not being stored correctly. This was traced back to the configuration of
our partition key (PK) and sort key (SK). In DynamoDB, the partition key
is crucial for uniquely identifying each item, while the sort key helps
organize data within a partition.

This change ensures that the combination of partition key and sort key
is unique for each record, preventing DynamoDB from overriding existing
records in case of a collision.

**Changes Made**

1. **Modification of Partition Key (PK) & Sort Key (SK):** 
- The PK was updated to ensure it uniquely identifies each record.
Previously, key collisions occurred because multiple records were using
the same PK value, leading to storage issues.

2. **Inclusion of `cause` in Stripe Idempotent Key:**
- Added `cause` as part of the Stripe idempotent key to ensure the
uniqueness of requests to Stripe, preventing duplicate processing.

3. **Renaming of Table from `egress-traffic` to
`egress-traffic-events`:**
- Since existing partition keys and sort keys cannot be updated, the
table was renamed and the keys were updated. The existing table will be
dropped to accommodate these changes.

**Impact**
- These changes resolve the storage issues for egress events and improve
data integrity and retrieval efficiency.
- The renaming and restructuring of the table ensure that future records
are stored and managed correctly.

Blocked by storacha/w3up#1588
fforbeck added a commit to storacha/freeway that referenced this pull request Nov 25, 2024
Added the `nonce` as suggested per @alanshaw, but also set it to not
expire, so we can process the invocation any time. The `servedAt` field
doesn't need to be converted to seconds.

Blocked by storacha/w3infra#443 &
storacha/w3up#1588
fforbeck pushed a commit that referenced this pull request Dec 9, 2024
🤖 I have created a release *beep* *boop*
---


##
[18.0.0](capabilities-v17.4.1...capabilities-v18.0.0)
(2024-12-05)


### ⚠ BREAKING CHANGES

* content serve authorization
([#1590](#1590))

### Features

* content serve authorization
([#1590](#1590))
([8b553a5](8b553a5))


### Fixes

* **egressRecord:** Remove unnecessary multiplication for ts conversion
([#1588](#1588))
([b7bc90e](b7bc90e))


### Other Changes

* **main:** release w3up-client 16.4.1
([#1577](#1577))
([1482d69](1482d69))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
fforbeck added a commit to storacha/upload-service that referenced this pull request Dec 11, 2024
storacha#1588)

### Context
This PR fixes the handling of the `servedAt` timestamp in the
`packages/upload-api/src/space/record.js` file.

The previous implementation included a multiplication by 1000, assuming
a conversion from seconds to milliseconds was necessary. This change
removes the conversion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants