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

Handle exception on long embed URL length causing messages to go to failed queue #395

Merged
merged 6 commits into from
Jan 4, 2024

Conversation

nobodyatroot
Copy link
Member

PR "handles" this exception that's causing messages to be dumped into the failed queue... which will never succeed unless the DB schema is updated. Regardless, this PR code won't have to change since it won't cause an exception if the URL column datatype is "fixed" / adjusted:

Failed Message Details
======================

 ------------- -------------------------------------------------------------------------------------------------------------------------------------------------------- 
  Class         App\Message\LinkEmbedMessage                                                                                                                            
  Message Id    16855846                                                                                                                                                
  Failed at     2024-01-03 21:01:45                                                                                                                                     
  Error         An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 7 ERROR:  value too long for type character varying(255)  
  Error Code    7                                                                                                                                                       
  Error Class   Doctrine\DBAL\Exception\DriverException                                                                                                                 
  Transport     failed                                                                                                                                                  
 ------------- -------------------------------------------------------------------------------------------------------------------------------------------------------- 

Embed URLs are limited to VARCHAR(255) by current DB schema:

image

Tested on a local 3 node federated cluster, works as expected: valid links (255 chars or less) still get entries put into the db, URLs that violate the current length limit are logged to debug channel.

@nobodyatroot nobodyatroot added enhancement New feature or request backend Backend related issues and pull requests labels Jan 4, 2024
e-five256
e-five256 previously approved these changes Jan 4, 2024
Copy link
Member

@e-five256 e-five256 left a comment

Choose a reason for hiding this comment

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

I'm a bit worried that we might forget about this and not notice why mbin is missing content in some situations, wonder if maybe it should be a warning rather than debug just in case but don't feel strongly about it. maybe it could change to a warning if we increase the length limit to something closer to url "max" like 2k, as then it's less likely to happen

@nobodyatroot
Copy link
Member Author

I'm a bit worried that we might forget about this and not notice why mbin is missing content in some situations, wonder if maybe it should be a warning rather than debug just in case but don't feel strongly about it

im fine with promoting it to warning, it doesn't happen that often..usually. agreed it'd be something good to know, new commit incoming.

@nobodyatroot nobodyatroot merged commit 94640e5 into main Jan 4, 2024
7 checks passed
@nobodyatroot nobodyatroot deleted the limit_entity_url_length branch January 4, 2024 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend related issues and pull requests enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants