Skip to content
New issue

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

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

Already on GitHub? # to your account

Failed sessions should be inserted with ended_on set #644

Merged
merged 4 commits into from
Jul 25, 2022

Conversation

rowanseymour
Copy link
Contributor

@rowanseymour rowanseymour commented Jul 25, 2022

We set this correctly if things fail on later resumes, but in the insert case after the first sprint, we only set ended_on for status=C sessions.

@codecov
Copy link

codecov bot commented Jul 25, 2022

Codecov Report

Merging #644 (cee3f65) into main (d6862d9) will increase coverage by 0.00%.
The diff coverage is 68.75%.

@@           Coverage Diff           @@
##             main     #644   +/-   ##
=======================================
  Coverage   61.99%   61.99%           
=======================================
  Files         132      132           
  Lines       12945    12944    -1     
=======================================
  Hits         8025     8025           
+ Misses       4054     4053    -1     
  Partials      866      866           
Impacted Files Coverage Δ
core/models/sessions.go 54.96% <68.75%> (+0.10%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us.


// if writing our sessions to S3, do so
if rt.Config.SessionStorage == "s3" {
err := WriteSessionOutputsToStorage(ctx, rt, sessions)
if err != nil {
// for now, continue on for errors, we are still reading from the DB
logrus.WithError(err).Error("error writing sessions to s3")
return nil, errors.Wrapf(err, "error writing sessions to storage")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is a holdover from when we always read output from DB and we were just testing S3 writes - if S3 writing fails now, that's an error

@rowanseymour rowanseymour requested a review from norkans7 July 25, 2022 20:31
modelContact, _ := testdata.Cathy.Load(db, oa)

_, flowSession, sprint1 := test.NewSessionBuilder().WithAssets(oa.SessionAssets()).WithFlow(ping.UUID).
WithContact(testdata.Bob.UUID, flows.ContactID(testdata.Cathy.ID), "Cathy", "eng", "").MustBuild()
Copy link
Contributor

Choose a reason for hiding this comment

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

typo testdata.Bob.UUID

@rowanseymour rowanseymour merged commit b809be6 into main Jul 25, 2022
@rowanseymour rowanseymour deleted the failed_session_fix branch July 25, 2022 23:09
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants