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

feat: adding storage client #191

Merged
merged 16 commits into from
Jun 21, 2024
Merged

feat: adding storage client #191

merged 16 commits into from
Jun 21, 2024

Conversation

pgautier404
Copy link
Collaborator

No description provided.

@pgautier404 pgautier404 force-pushed the add-storage-client branch from 0929090 to d4c5255 Compare June 7, 2024 17:38
Copy link
Contributor

@cprice404 cprice404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just clearing this off of my review list for now, please add me again when it's ready for 👀 !

@pgautier404 pgautier404 marked this pull request as ready for review June 20, 2024 00:32
@pgautier404 pgautier404 requested a review from cprice404 June 20, 2024 00:32
Copy link
Collaborator

@malandis malandis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No API concerns just some questions / minor issues

src/Auth/StringMomentoTokenProvider.php Show resolved Hide resolved
Comment on lines +33 to +36
/**
* Item with specified name doesn't exist
*/
public const ITEM_NOT_FOUND_ERROR = "ITEM_NOT_FOUND_ERROR";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should call this STORE_ITEM... to disambiguate vs cache items.

Copy link
Collaborator Author

@pgautier404 pgautier404 Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no not found error for cache items-- those are represented as misses. This is also how this is defined in the JS SDK. I'm not necessarily opposed to changing this error code to be specific to storage for future-proofing, but we should be consistent across SDKs. I'm going to leave this for now to maintain consistency with other SDKs but am happy to discuss further.

Comment on lines +258 to +266
/**
* Item with specified name doesn't exist
*/
class ItemNotFoundError extends SdkError
{
public string $errorCode = MomentoErrorCode::ITEM_NOT_FOUND_ERROR;
public string $messageWrapper = 'An item with the specified name does not exist. To resolve this error, make sure you have created the item before attempting to use it';
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename should extend here too.

src/Cache/Internal/ScsControlClient.php Show resolved Hide resolved
src/Config/Configurations/StorageInRegion.php Outdated Show resolved Hide resolved
src/Storage/PreviewStorageClient.php Outdated Show resolved Hide resolved
src/Storage/PreviewStorageClient.php Outdated Show resolved Hide resolved
src/Storage/PreviewStorageClient.php Outdated Show resolved Hide resolved
Comment on lines 489 to 493
public function type(): string
{
throw $this->innerException();
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we throwing exceptions here vs returning null?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, I wasn't sure how far to take this. Same question applies to found() as well, which makes sense as both null and false in the error class.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switched it so both type() and found() return null from the error class.

src/Utilities/_ErrorConverter.php Outdated Show resolved Hide resolved
@pgautier404 pgautier404 requested a review from malandis June 20, 2024 23:06
@pgautier404 pgautier404 merged commit d6bcc98 into main Jun 21, 2024
6 checks passed
@pgautier404 pgautier404 deleted the add-storage-client branch June 21, 2024 00:41
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.

3 participants