Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Lock] DynamoDB store #60138

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

Open
wants to merge 33 commits into
base: 7.4
Choose a base branch
Loading
from
Open
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
11c3b24
[Lock][WIP] Initial pass on DynamoDb lock store
natepage Apr 4, 2025
c606c47
[Lock][WIP] Move DynamoDbStore into its own bridge package
natepage Apr 9, 2025
93677c8
[Lock][WIP] Test DynamoDbStore against local DynamoDB instance in int…
natepage Apr 9, 2025
03acce4
[Lock][WIP] Address some of reviews comments and CS
natepage Apr 9, 2025
0fec459
[Lock][WIP] Fix license headers
natepage Apr 9, 2025
94bccf3
[Lock][WIP] Fix license headers - 1
natepage Apr 9, 2025
4cef875
[Lock][WIP] Psalm InvalidArgument errors are confusing me...
natepage Apr 9, 2025
02b7368
[Lock][WIP] Try to debug package tests failure
natepage Apr 9, 2025
f34fe01
[Lock][WIP] Try to debug package tests failure - 1
natepage Apr 9, 2025
fa6c74d
[Lock][WIP] Fix match case for component_bridge in get-modified-packa…
natepage Apr 9, 2025
ec36e98
[Lock][WIP] Copy AbstractStoreTestCase from Lock component to bridge
natepage Apr 9, 2025
f877628
[Lock][WIP] Disable ssl in integration tests
natepage Apr 9, 2025
f3d2a06
[Lock][WIP] Support sslmode option in DynamoDbStore
natepage Apr 9, 2025
31014f9
[Lock][WIP] Fix createTable input
natepage Apr 9, 2025
ac28237
[Lock][WIP] Ensure microtime return a float
natepage Apr 9, 2025
10579c6
[Lock][WIP] Fix :token attribute value in putOffExpiration
natepage Apr 9, 2025
cd78429
[Lock][WIP] Debug exists function
natepage Apr 9, 2025
0b16e0f
[Lock][WIP] Fix exists logic
natepage Apr 9, 2025
a3c7d91
[Lock][WIP] Try to address psalm error
natepage Apr 9, 2025
6484cfa
[Lock][WIP] Make default region and endpoint options null to use defa…
natepage Apr 10, 2025
abbc213
[Lock][WIP] Move integration tests to Functional dir and add unit tests
natepage Apr 10, 2025
106eeac
[Lock][WIP] Add unit tests with assertEquals for dsn process
natepage Apr 10, 2025
7dfb08a
[Lock][WIP] Default options in case DynamoDbClient instance given
natepage Apr 10, 2025
170bcef
[Lock][WIP] Replicate constructor testing from SQS Connection
natepage Apr 10, 2025
64e7380
[Lock][WIP] Fix default region in tests
natepage Apr 10, 2025
dbb4ae2
[Lock][WIP] Fix invalid and unsupported DSN tests
natepage Apr 10, 2025
c685c71
[Lock] Address review comments
natepage Apr 11, 2025
1ff0a60
[Lock] Make fabbot happy
natepage Apr 11, 2025
fa64c21
[Lock] Address review comments
natepage Apr 17, 2025
f357506
[Lock] Fix RedisStoreTestCase filename
natepage Apr 17, 2025
a0739ce
[Lock] Address review comments
natepage Apr 17, 2025
ff40b91
[Lock] Create DynamoDB table in save if it doesn't exist
natepage May 6, 2025
4f0a780
[Lock] Address review comments
natepage May 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[Lock][WIP] Fix exists logic
  • Loading branch information
natepage committed Apr 9, 2025
commit 0b16e0fda6208e299bcda8eeb0f1dcacf6b4de95
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
if (preg_match(';^dynamodb\.([^\.]++)\.amazonaws\.com$;', $params['host'], $matches)) {
$clientConfiguration['region'] = $matches[1];
}
} elseif (self::DEFAULT_OPTIONS['endpoint'] !== $options['endpoint'] ?? self::DEFAULT_OPTIONS['endpoint']) {

Check failure on line 118 in src/Symfony/Component/Lock/Bridge/DynamoDb/Store/DynamoDbStore.php

View workflow job for this annotation

GitHub Actions / Psalm

InvalidArgument

src/Symfony/Component/Lock/Bridge/DynamoDb/Store/DynamoDbStore.php:118:23: InvalidArgument: Isset only works with variables and array elements (see https://psalm.dev/004)

Check failure on line 118 in src/Symfony/Component/Lock/Bridge/DynamoDb/Store/DynamoDbStore.php

View workflow job for this annotation

GitHub Actions / Psalm

InvalidArgument

src/Symfony/Component/Lock/Bridge/DynamoDb/Store/DynamoDbStore.php:118:23: InvalidArgument: Isset only works with variables and array elements (see https://psalm.dev/004)
$clientConfiguration['endpoint'] = $options['endpoint'];
}

Expand Down Expand Up @@ -190,24 +190,16 @@

// Item not found at all
if ($item === []) {
\var_dump('Item not found');

return false;
}

// We are not the owner
if (isset($item[$this->tokenAttr]) === false || $this->getUniqueToken($key) !== $item[$this->tokenAttr]->getS()) {
\var_dump('Not owner', ['item' => $item, 'token' => $this->getUniqueToken($key)]);

if (!isset($item[$this->tokenAttr]) || $this->getUniqueToken($key) !== $item[$this->tokenAttr]->getS()) {
return false;
}

// If item is expired, consider it doesn't exist
$expired = isset($item[$this->expirationAttr]) && \microtime(true) >= $item[$this->expirationAttr]->getN();

\var_dump('Expired', ['item' => $item, 'expired' => $expired]);

return $expired;
return isset($item[$this->expirationAttr]) && ((float) $item[$this->expirationAttr]->getN()) > \microtime(true);
}

public function putOffExpiration(Key $key, float $ttl): void
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.