Add ability to jump to a certain 'X' hours ago on the timeline #688

Merged
prologic merged 3 commits from develop into master 2 weeks ago
prologic commented 2 weeks ago
Owner

Redo of #686

Redo of #686
prologic added 2 commits 2 weeks ago
96995c5d92
Add ability to jump to a certain 'X' hours ago on the timeline && increase cache consistency, refactor internal/post_handler (#686)
73116563de
Remove unrelated changes
prologic force-pushed develop from 73116563de to a1cc5a93dd 2 weeks ago
prologic added 1 commit 2 weeks ago
44b229f3f2 Merge branch 'master' into develop
Poster
Owner

@eldersnake We need your help here bud 🤗

We're not actually sure if this PR will do what you want.

We have a couple of options here;

  • We can merge it anyway since it's behind a Feature Flag
  • Or you can rebuild your Pod with this

Are you able to help us vet/validate this PR?

@eldersnake We need your help here bud 🤗 We're not actually sure if this PR will do what you want. We have a couple of options here; - We can merge it anyway since it's behind a Feature Flag - Or you can rebuild your Pod with this Are you able to help us vet/validate this PR?
prologic merged commit f86f1ed5d9 into master 2 weeks ago
prologic deleted branch develop 2 weeks ago
Collaborator

Sorry mate, only just saw the notification for this. I tried running it from master with the feature flag set and got this:

2022/01/15 17:02:19 http: panic serving 127.0.0.1:44102: runtime error: integer divide by zero
goroutine 916 [running]:
net/http.(*conn).serve.func1(0x349aa80)
	/usr/local/go/src/net/http/server.go:1801 +0xdc
panic({0x823938, 0xeffca0})
	/usr/local/go/src/runtime/panic.go:1052 +0x2e8
git.mills.io/yarnsocial/yarn/internal.FilterTwtsAge({0x3875000, 0x450, 0x500}, 0x0, 0x0)
	/home/pi/src/yarn/internal/utils.go:1706 +0x1a0
git.mills.io/yarnsocial/yarn/internal.(*Server).TimelineHandler.func1({0xa79248, 0x3882c50}, 0x36b7d80, {0x0, 0x0, 0x0})
	/home/pi/src/yarn/internal/view_handlers.go:87 +0x564
github.com/slok/go-http-metrics/middleware/httprouter.Handler.func1.1({0xa79248, 0x3882c50}, 0x36b7d80)
	/home/pi/golang/pkg/mod/github.com/slok/go-http-metrics@v0.9.0/middleware/httprouter/httprouter.go:18 +0x4c
net/http.HandlerFunc.ServeHTTP(0x1ed52c0, {0xa79248, 0x3882c50}, 0x36b7d80)
	/usr/local/go/src/net/http/server.go:2046 +0x34
github.com/slok/go-http-metrics/middleware/std.Handler.func1.1()
	/home/pi/golang/pkg/mod/github.com/slok/go-http-metrics@v0.9.0/middleware/std/std.go:27 +0x3c
github.com/slok/go-http-metrics/middleware.Middleware.Measure({{{0xa7922c, 0x327b060}, {0x8aea00, 0x5}, 0x1, 0x0, 0x0}}, {0x8b35e3, 0x8}, {0xa7dff8, ...}, ...)
	/home/pi/golang/pkg/mod/github.com/slok/go-http-metrics@v0.9.0/middleware/middleware.go:117 +0x1c0
github.com/slok/go-http-metrics/middleware/std.Handler.func1({0xa78f1c, 0x38a8380}, 0x36b7d80)
	/home/pi/golang/pkg/mod/github.com/slok/go-http-metrics@v0.9.0/middleware/std/std.go:26 +0x154
net/http.HandlerFunc.ServeHTTP(0x2414ea0, {0xa78f1c, 0x38a8380}, 0x36b7d80)
	/usr/local/go/src/net/http/server.go:2046 +0x34
github.com/slok/go-http-metrics/middleware/httprouter.Handler.func1({0xa78f1c, 0x38a8380}, 0x36b7d80, {0x0, 0x0, 0x0})
	/home/pi/golang/pkg/mod/github.com/slok/go-http-metrics@v0.9.0/middleware/httprouter/httprouter.go:21 +0x108
github.com/julienschmidt/httprouter.(*Router).ServeHTTP(0x307d880, {0xa78f1c, 0x38a8380}, 0x36b7d80)
	/home/pi/golang/pkg/mod/github.com/julienschmidt/httprouter@v1.3.0/router.go:387 +0x990
git.mills.io/yarnsocial/yarn/internal.(*Router).ServeHTTP(0x307d880, {0xa78f1c, 0x38a8380}, 0x36b7d80)
	/home/pi/src/yarn/internal/router.go:136 +0x38
github.com/justinas/nosurf.(*CSRFHandler).handleSuccess(...)
	/home/pi/golang/pkg/mod/github.com/justinas/nosurf@v1.1.1/handler.go:187
github.com/justinas/nosurf.(*CSRFHandler).ServeHTTP(0x1d221e0, {0xa78f1c, 0x38a8380}, 0x36b7d00)
	/home/pi/golang/pkg/mod/github.com/justinas/nosurf@v1.1.1/handler.go:144 +0x630
git.mills.io/yarnsocial/yarn/internal/session.(*Manager).Handler.func1({0xa78f1c, 0x38a8380}, 0x36b7c00)
	/home/pi/src/yarn/internal/session/manager.go:164 +0x354
net/http.HandlerFunc.ServeHTTP(0x327a260, {0xa78f1c, 0x38a8380}, 0x36b7c00)
	/usr/local/go/src/net/http/server.go:2046 +0x34
github.com/NYTimes/gziphandler.GzipHandlerWithOpts.func1.1({0xa794b0, 0x3882be0}, 0x36b7c00)
	/home/pi/golang/pkg/mod/github.com/!n!y!times/gziphandler@v1.1.1/gzip.go:338 +0x27c
net/http.HandlerFunc.ServeHTTP(0x3276240, {0xa794b0, 0x3882be0}, 0x36b7c00)
	/usr/local/go/src/net/http/server.go:2046 +0x34
github.com/unrolled/logger.(*Logger).Handler.func1({0xa79868, 0x223f680}, 0x36b7c00)
	/home/pi/golang/pkg/mod/github.com/unrolled/logger@v0.0.0-20201216141554-31a3694fe979/logger.go:80 +0xbc
net/http.HandlerFunc.ServeHTTP(0x327a270, {0xa79868, 0x223f680}, 0x36b7c00)
	/usr/local/go/src/net/http/server.go:2046 +0x34
net/http.serverHandler.ServeHTTP({0x321a510}, {0xa79868, 0x223f680}, 0x36b7c00)
	/usr/local/go/src/net/http/server.go:2878 +0x3f0
net/http.(*conn).serve(0x349aa80, {0xa79d64, 0x33a43d8})
	/usr/local/go/src/net/http/server.go:1929 +0xcc4
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:3033 +0x474

Basically the Pod server will error 502 with it enabled.

Sorry mate, only just saw the notification for this. I tried running it from master with the feature flag set and got this: ``` 2022/01/15 17:02:19 http: panic serving 127.0.0.1:44102: runtime error: integer divide by zero goroutine 916 [running]: net/http.(*conn).serve.func1(0x349aa80) /usr/local/go/src/net/http/server.go:1801 +0xdc panic({0x823938, 0xeffca0}) /usr/local/go/src/runtime/panic.go:1052 +0x2e8 git.mills.io/yarnsocial/yarn/internal.FilterTwtsAge({0x3875000, 0x450, 0x500}, 0x0, 0x0) /home/pi/src/yarn/internal/utils.go:1706 +0x1a0 git.mills.io/yarnsocial/yarn/internal.(*Server).TimelineHandler.func1({0xa79248, 0x3882c50}, 0x36b7d80, {0x0, 0x0, 0x0}) /home/pi/src/yarn/internal/view_handlers.go:87 +0x564 github.com/slok/go-http-metrics/middleware/httprouter.Handler.func1.1({0xa79248, 0x3882c50}, 0x36b7d80) /home/pi/golang/pkg/mod/github.com/slok/go-http-metrics@v0.9.0/middleware/httprouter/httprouter.go:18 +0x4c net/http.HandlerFunc.ServeHTTP(0x1ed52c0, {0xa79248, 0x3882c50}, 0x36b7d80) /usr/local/go/src/net/http/server.go:2046 +0x34 github.com/slok/go-http-metrics/middleware/std.Handler.func1.1() /home/pi/golang/pkg/mod/github.com/slok/go-http-metrics@v0.9.0/middleware/std/std.go:27 +0x3c github.com/slok/go-http-metrics/middleware.Middleware.Measure({{{0xa7922c, 0x327b060}, {0x8aea00, 0x5}, 0x1, 0x0, 0x0}}, {0x8b35e3, 0x8}, {0xa7dff8, ...}, ...) /home/pi/golang/pkg/mod/github.com/slok/go-http-metrics@v0.9.0/middleware/middleware.go:117 +0x1c0 github.com/slok/go-http-metrics/middleware/std.Handler.func1({0xa78f1c, 0x38a8380}, 0x36b7d80) /home/pi/golang/pkg/mod/github.com/slok/go-http-metrics@v0.9.0/middleware/std/std.go:26 +0x154 net/http.HandlerFunc.ServeHTTP(0x2414ea0, {0xa78f1c, 0x38a8380}, 0x36b7d80) /usr/local/go/src/net/http/server.go:2046 +0x34 github.com/slok/go-http-metrics/middleware/httprouter.Handler.func1({0xa78f1c, 0x38a8380}, 0x36b7d80, {0x0, 0x0, 0x0}) /home/pi/golang/pkg/mod/github.com/slok/go-http-metrics@v0.9.0/middleware/httprouter/httprouter.go:21 +0x108 github.com/julienschmidt/httprouter.(*Router).ServeHTTP(0x307d880, {0xa78f1c, 0x38a8380}, 0x36b7d80) /home/pi/golang/pkg/mod/github.com/julienschmidt/httprouter@v1.3.0/router.go:387 +0x990 git.mills.io/yarnsocial/yarn/internal.(*Router).ServeHTTP(0x307d880, {0xa78f1c, 0x38a8380}, 0x36b7d80) /home/pi/src/yarn/internal/router.go:136 +0x38 github.com/justinas/nosurf.(*CSRFHandler).handleSuccess(...) /home/pi/golang/pkg/mod/github.com/justinas/nosurf@v1.1.1/handler.go:187 github.com/justinas/nosurf.(*CSRFHandler).ServeHTTP(0x1d221e0, {0xa78f1c, 0x38a8380}, 0x36b7d00) /home/pi/golang/pkg/mod/github.com/justinas/nosurf@v1.1.1/handler.go:144 +0x630 git.mills.io/yarnsocial/yarn/internal/session.(*Manager).Handler.func1({0xa78f1c, 0x38a8380}, 0x36b7c00) /home/pi/src/yarn/internal/session/manager.go:164 +0x354 net/http.HandlerFunc.ServeHTTP(0x327a260, {0xa78f1c, 0x38a8380}, 0x36b7c00) /usr/local/go/src/net/http/server.go:2046 +0x34 github.com/NYTimes/gziphandler.GzipHandlerWithOpts.func1.1({0xa794b0, 0x3882be0}, 0x36b7c00) /home/pi/golang/pkg/mod/github.com/!n!y!times/gziphandler@v1.1.1/gzip.go:338 +0x27c net/http.HandlerFunc.ServeHTTP(0x3276240, {0xa794b0, 0x3882be0}, 0x36b7c00) /usr/local/go/src/net/http/server.go:2046 +0x34 github.com/unrolled/logger.(*Logger).Handler.func1({0xa79868, 0x223f680}, 0x36b7c00) /home/pi/golang/pkg/mod/github.com/unrolled/logger@v0.0.0-20201216141554-31a3694fe979/logger.go:80 +0xbc net/http.HandlerFunc.ServeHTTP(0x327a270, {0xa79868, 0x223f680}, 0x36b7c00) /usr/local/go/src/net/http/server.go:2046 +0x34 net/http.serverHandler.ServeHTTP({0x321a510}, {0xa79868, 0x223f680}, 0x36b7c00) /usr/local/go/src/net/http/server.go:2878 +0x3f0 net/http.(*conn).serve(0x349aa80, {0xa79d64, 0x33a43d8}) /usr/local/go/src/net/http/server.go:1929 +0xcc4 created by net/http.(*Server).Serve /usr/local/go/src/net/http/server.go:3033 +0x474 ``` Basically the Pod server will error 502 with it enabled.
Poster
Owner

@eldersnake What's your -T, --twts-per-page int maximum twts per page to display (default 50) setting?

@eldersnake What's your `-T, --twts-per-page int maximum twts per page to display (default 50)` setting?
Poster
Owner

@eldersnake f86f98e should help prevent the case you reported above 👌

@eldersnake f86f98e should help prevent the case you reported above 👌
Collaborator

@prologic okay that fixed the error, I'm just not sure what I'm supposed to be looking at haha. The UI looks pretty much the same? 🤔

@prologic okay that fixed the error, I'm just not sure what I'm supposed to be looking at haha. The UI looks pretty much the same? 🤔
Collaborator

@eldersnake there is no UI for it yet. Got any suggestions as to what this might look like?

@eldersnake there is no UI for it yet. Got any suggestions as to what this might look like?
Poster
Owner

@prologic okay that fixed the error, I'm just not sure what I'm supposed to be looking at haha. The UI looks pretty much the same? 🤔

Does the query string parameter work as you might expect though?

> @prologic okay that fixed the error, I'm just not sure what I'm supposed to be looking at haha. The UI looks pretty much the same? 🤔 Does the query string parameter work as you might expect though?
Collaborator

@prologic okay that fixed the error, I'm just not sure what I'm supposed to be looking at haha. The UI looks pretty much the same? 🤔

Does the query string parameter work as you might expect though?

Hmm, I tried with various numbers like ?t=150 appended to the URL but no matter the number nothing seems to happen, it displays the timeline as normal.

> > @prologic okay that fixed the error, I'm just not sure what I'm supposed to be looking at haha. The UI looks pretty much the same? 🤔 > > Does the query string parameter work as you might expect though? Hmm, I tried with various numbers like `?t=150` appended to the URL but no matter the number nothing seems to happen, it displays the timeline as normal.
continuous-integration/drone/pr Build is passing
The pull request has been merged as f86f1ed5d9.
Sign in to join this conversation.
Loading…
There is no content yet.