socketlabs / socketlabs-ruby Goto Github PK
View Code? Open in Web Editor NEWSocketLabs Email Delivery Ruby Client Library https://www.socketlabs.com
License: MIT License
SocketLabs Email Delivery Ruby Client Library https://www.socketlabs.com
License: MIT License
Hey Socketlabs team!
I signed up for a dev account and started working with this gem last night. I started with the example code displayed on onboarding and tweaked it a bit to test send an email. After calling client.send(message)
, the process appears to hang.
Retry Handler will continue to send successful requests endlessly, causing emails to send until the server rejects the request or the process is terminated.
The retry handler appears to continue to send the same message repeatedly even if the message has already been sent or if an 500, 502-504 range HTTP status code is returned. The only time this stops is if the client encounters a non-timeout exception or a timeout exception after retries attempts conditions have been met.
After a bit of digging, it appears a successful response is never returned in RetryHandler, causing an endless loop of successful requests.
This occurs both when maximum_number_of_retries
is set to 0 or greater than 0.
This can be reproduced by using the current client, Ruby 2.7.0(but any ruby should have similar results), and the Ruby onboarding code. My gist will also reproduce it.
I have a fork with the following updates that fix several issues related to the retry response and returning the response. I added this for my needs, but believe it'll be helpful to other users of the gem.
InjectionResponseParser::parse
instead of InjectionResponseParser
instance.I'm trying to send a basic email from a local app and keep running into an error with the validation of the server ID number. The documentation is clear that it should be an integer, but the validation function is failing on the empty check. Here is the stack trace, with my server ID changed to a nonsense integer.
Traceback (most recent call last):
5: from email_test.rb:21:in `<main>'
4: from email_test.rb:18:in `send_basic_email'
3: from /home/matthew/.rvm/gems/ruby-2.7.5/gems/socketlabs-injectionapi-1.2.1/lib/socketlabs/injectionapi/socketlabsclient.rb:44:in `send'
2: from /home/matthew/.rvm/gems/ruby-2.7.5/gems/socketlabs-injectionapi-1.2.1/lib/socketlabs/injectionapi/socketlabsclient.rb:83:in `send_basic_message'
1: from /home/matthew/.rvm/gems/ruby-2.7.5/gems/socketlabs-injectionapi-1.2.1/lib/socketlabs/injectionapi/socketlabsclient.rb:141:in `validate_message'
/home/matthew/.rvm/gems/ruby-2.7.5/gems/socketlabs-injectionapi-1.2.1/lib/socketlabs/injectionapi/core/send_validator.rb:47:in `validate_credentials': undefined method `empty?' for 123:Integer (NoMethodError)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.