Skip to content

Commit

Permalink
Update deps including gocommon which changes requirement for storage …
Browse files Browse the repository at this point in the history
…paths to start with slash
  • Loading branch information
rowanseymour committed Jul 20, 2023
1 parent 1e8681a commit b888551
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 63 deletions.
10 changes: 1 addition & 9 deletions core/models/orgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"mime"
"net/http"
"path/filepath"
"strings"
"time"

"github.com/jmoiron/sqlx"
Expand Down Expand Up @@ -209,14 +208,7 @@ func (o *Org) attachmentPath(prefix string, filename string) string {
}
parts = append(parts, filename)

path := filepath.Join(parts...)

// ensure path begins with /
if !strings.HasPrefix(path, "/") {
path = fmt.Sprintf("/%s", path)
}

return path
return filepath.Join(parts...)
}

// gets the underlying org for the given session assets
Expand Down
3 changes: 1 addition & 2 deletions core/models/sessions.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ func (s *Session) Scene() *Scene { return s.scene }
func (s *Session) StoragePath() string {
ts := s.CreatedOn().UTC().Format(storageTSFormat)

// example output: /orgs/1/c/20a5/20a5534c-b2ad-4f18-973a-f1aa3b4e6c74/20060102T150405.123Z_session_8a7fc501-177b-4567-a0aa-81c48e6de1c5_51df83ac21d3cf136d8341f0b11cb1a7.json"
// example output: orgs/1/c/20a5/20a5534c-b2ad-4f18-973a-f1aa3b4e6c74/20060102T150405.123Z_session_8a7fc501-177b-4567-a0aa-81c48e6de1c5_51df83ac21d3cf136d8341f0b11cb1a7.json"
return path.Join(
"/", // see https://github.com/nyaruka/gocommon/pull/90
"orgs",
fmt.Sprintf("%d", s.OrgID()),
"c",
Expand Down
38 changes: 19 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@ go 1.19

require (
github.com/Masterminds/semver v1.5.0
github.com/aws/aws-sdk-go v1.44.204
github.com/aws/aws-sdk-go v1.44.305
github.com/buger/jsonparser v1.1.1
github.com/edganiukov/fcm v0.4.0
github.com/go-chi/chi v4.1.2+incompatible
github.com/go-playground/validator/v10 v10.11.2
github.com/go-playground/validator/v10 v10.14.1
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/golang/protobuf v1.5.2
github.com/golang/protobuf v1.5.3
github.com/gomodule/redigo v1.8.9
github.com/gorilla/schema v1.2.0
github.com/jmoiron/sqlx v1.3.5
github.com/lib/pq v1.10.7
github.com/lib/pq v1.10.9
github.com/nyaruka/ezconf v0.2.1
github.com/nyaruka/gocommon v1.35.0
github.com/nyaruka/goflow v0.186.1
github.com/nyaruka/gocommon v1.37.0
github.com/nyaruka/goflow v0.187.0
github.com/nyaruka/logrus_sentry v0.8.2-0.20190129182604-c2962b80ba7d
github.com/nyaruka/null/v2 v2.0.3
github.com/nyaruka/redisx v0.3.1
github.com/nyaruka/rp-indexer/v8 v8.0.3
github.com/olivere/elastic/v7 v7.0.32
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pkg/errors v0.9.1
github.com/prometheus/client_model v0.3.0
github.com/prometheus/common v0.39.0
github.com/prometheus/client_model v0.4.0
github.com/prometheus/common v0.44.0
github.com/shopspring/decimal v1.3.1
github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.8.3
golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.8.4
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1
)

require (
Expand All @@ -40,27 +40,27 @@ require (
github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/getsentry/raven-go v0.2.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/gofrs/uuid v4.4.0+incompatible // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/naoina/go-stringutil v0.1.0 // indirect
github.com/naoina/toml v0.1.1 // indirect
github.com/nyaruka/librato v1.0.0 // indirect
github.com/nyaruka/phonenumbers v1.1.6 // indirect
github.com/nyaruka/phonenumbers v1.1.7 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit b888551

Please sign in to comment.