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

When using old data purger, content tracking names are being deleted. #7958

Closed
mgazdzik opened this issue May 21, 2015 · 13 comments
Closed

When using old data purger, content tracking names are being deleted. #7958

mgazdzik opened this issue May 21, 2015 · 13 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@mgazdzik
Copy link
Contributor

Goal of this ticket is to fix following bug:

columns holding content-related action_ids should also be included.
Also maybe it would be a good opportunity to refactor this place so columns respected can be added dynamically?

@mgazdzik mgazdzik added the Bug For errors / faults / flaws / inconsistencies etc. label May 21, 2015
@diosmosis diosmosis added this to the 2.14.0 milestone May 21, 2015
@diosmosis diosmosis self-assigned this May 21, 2015
@diosmosis
Copy link
Member

@mgazdzik It's definitely a bug. I've assigned myself, since I changed the purger in another PR. We can perhaps get the column names by looking for 'idaction' columns.

@mgazdzik
Copy link
Contributor Author

It could be a way, but it will not allow any custom plugins to prevent their data in log_action from being deleted, and I imagine that it's gonna be tricky to enforce all custom plugins to use "idaction_" prefix for their dictionary columns?
My personal oppinion is to go for something easily extendible, but core issue will be solved by either of approaches.

@diosmosis
Copy link
Member

It could be a way, but it will not allow any custom plugins to prevent their data in log_action from being deleted,

I see your point. We could use DI, alllow plugins to append column names to the array. This would also avoid creating a new event for something this small.

@mgazdzik
Copy link
Contributor Author

If it's documented well and easy to extend for developers, then I'm 💯 % for it :)

@tsteur
Copy link
Member

tsteur commented May 21, 2015

I'm not 100% into this topic. Ideally everything would just work automatically as know matter what a developer has to do, it will be forgotten etc. A custom plugin developer won't be able to know whether to listen to an event or DI or ... Is it maybe possible to use somehow existing information for this? Eg we have those Dimension classes: https://github.com/piwik/piwik/blob/2.14.0-b1/plugins/Contents/Columns/ContentName.php and know whether it defines an idAction and we also have those Action extensions https://github.com/piwik/piwik/blob/2.14.0-b1/plugins/Contents/Actions/ActionContent.php

If not possible to use any of this information, can we maybe refactor Dimensions in a way that it would be possible? If not, ignore this comment :) As I said I'm not 100% into this topic

@diosmosis
Copy link
Member

I thought about that, it would be better if it was automatic. The only thing I could think of is to store a property in Dimension like $isActionReference. Problems w/ this approach include:

  1. It exposes an implementation detail in the 'concept' layer (so-to-speak). In my mind, Dimension classes shouldn't be tied to relational DB implementation details (such as column type, or whether the actual dimension data is stored in a different table (ie, log_action)). Since we already do this, and Piwik's not likely to support NoSQL anytime soon, I guess it's not that important.
  2. Plugin developers would still have to be aware of this and set it.
  3. If a plugin developer doesn't use Dimension classes, there's no way to add the column.

Could do both, add a property to DImension classes & allow manipulation via DI. Then if a plugin developer finds out there's a problem w/ their plugin + log data purging, they can at least fix it.

@tsteur
Copy link
Member

tsteur commented May 21, 2015

  1. We can absolutely ignore NoSQL. Once this will be implemented we'll have to refactor things anyway. We don't need to think about that for now. It's rather important to make things for developers as nice and simple as possible.
  2. That sucks a bit. I was hoping we could use that https://github.com/piwik/piwik/blob/2.14.0-b1/plugins/Contents/Actions/ActionContent.php#L39 and that https://github.com/piwik/piwik/blob/2.14.0-b1/plugins/Contents/Columns/ContentName.php#L38 information. The tracker does already create a reference based on that automatically. I'm really not into this topic that's why it might sound stupid: Isn't it possible to check whether the ContentName defines a getIdAction method and a onLookupAction? The logic in Action is currently here: https://github.com/piwik/piwik/blob/2.14.0-b1/core/Tracker/Action.php#L295
  3. We don't want to allow new Dimensions in the future that are not defined why a Dimension class.

In general I do not like having two solutions for one problem. It makes it always complicated and one never knows which one to use etc. Still hoping to fix it automatically to avoid plugin developers to notice that there's a log purger problem :)

@diosmosis
Copy link
Member

Is it required for dimensions that are log_action references to implement getActionId()? If so, then I can use this.

@tsteur
Copy link
Member

tsteur commented May 21, 2015

Yep, if they want to use an action reference. It throws an exception otherwise: https://github.com/piwik/piwik/blob/2.14.0-b1/core/Plugin/Dimension/ActionDimension.php#L173

@diosmosis
Copy link
Member

Will make use of it then.

@diosmosis
Copy link
Member

@tsteur getActionId() is only for ActionDimensions. Is it possible for developers to create VisitDimensions & ConversionDimensions that are action references?

@tsteur
Copy link
Member

tsteur commented May 21, 2015

I'm not aware on any re VisitDimension or log_visit. A ConversionDimension neither from what I know.

@diosmosis
Copy link
Member

Fixed by #7964

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

3 participants