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

Impressionist counter_cache not working #1196

Closed
jywarren opened this issue Jan 19, 2017 · 3 comments · Fixed by #5338
Closed

Impressionist counter_cache not working #1196

jywarren opened this issue Jan 19, 2017 · 3 comments · Fixed by #5338
Labels
help wanted requires help by anyone willing to contribute Ruby

Comments

@jywarren
Copy link
Member

jywarren commented Jan 19, 2017

What happened just before the problem occurred

We've installed the impressionist gem and are successfully counting unique impressions on pages now. But the "counter cache" setup (which would keep a column on the node table updated with a calculated tally of views) is not working, though that's in the code:

https://github.com/publiclab/plots2/blob/master/app/models/node.rb#L181

We've temporarily based node.totalcount on the sum of node.legacy_views + node.impressions_count:

https://github.com/publiclab/plots2/blob/master/app/models/node.rb#L183-L187

However, if we can get this line of the tests passing, we can re-institute the cached value, which will improve performance for node page views (notes and wikis):

https://github.com/publiclab/plots2/blob/master/test/functional/notes_controller_test.rb#L74

jywarren added a commit to jywarren/plots2 that referenced this issue Jan 19, 2017
@jywarren jywarren mentioned this issue Jan 19, 2017
6 tasks
jywarren added a commit that referenced this issue Jan 20, 2017
* counter fixes

* more totalcount excising

* completed count > views changes, I believe

* schema changes

* db schema tweak

* schema example tweak

* more controller changes

* controller changes for impressionable

* inconsistent test resolution

* test addition for inconsistencies

* test tweaks

* test tweak

* test fix

* additional

* fixed!?

* testing node.views incrementing in controllers with impressionist gem

* attempt to clear impressions to test unique ips

* further attempts

* workaround for node.views counter_cache, see #1196

* Timecop test fixes

* changes for wiki tests as well

* clear uniques before wiki test

* test fixes via new integration test
@jywarren jywarren added help wanted requires help by anyone willing to contribute Ruby labels Jan 20, 2017
@ghost
Copy link

ghost commented Feb 4, 2017

@jywarren , Is this issue fixed ? If not, can i pick it up ?

@jywarren
Copy link
Member Author

jywarren commented Feb 6, 2017

It is not fixed yet -- yes, that'd be great. Tell me if you need help diving in!

@ryzokuken
Copy link
Member

@imsarath Are you currently working on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted requires help by anyone willing to contribute Ruby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants