Skip to content

feat: add support for Daily Active User feature - #19771

Merged
mshabarov merged 3 commits into
mainfrom
feat/dau_support
Aug 12, 2024
Merged

mshabarov merged 3 commits into
mainfrom
feat/dau_support

Conversation

@mcollovati

Copy link
Copy Markdown
Collaborator

Integrates with License Checker to add support for Daily Active User feature for DAU enabled production build artifacts.

Integrates with License Checker to add support for Daily Active User
feature for DAU enabled production build artifacts.
Comment thread flow-server/pom.xml
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>license-checker</artifactId>
<scope>provided</scope>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

big thumbs down!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LicenseChecker API is now used by Flow server at runtime, it's better to use compile scope thus.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I understand why it's done but I still think this is really bad. flow-server should NOT depend on commercial things. If the DAU feature or other things require to be run by flow.. shouldn't those be discovered by flow via service discovery or any other means? Now open-source flow depends on something that is "open source" by license, but NOT open source accessible making it a really big problem for audits.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We have to test if the provided scope works in runtime if any commercial Vaadin product is used.
My assumption that yes, because if one uses com.vaadin:vaadin artifact, the license-checker dependency is fetched anyway, e.g. by Collaboration Engine.

If it's not the case, it think we can go with plan B consisting in using something like service loader or reflection.

Brilliant comment by the way!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I restored the provided scope and split some classes so that a normal application will not fail if license checker not is not present at runtime.

* http request from browser
* @return http cookie to be used to count application's end-users daily
*/
public static Cookie generateNewCookie(VaadinRequest request) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Storing cookies is in my opinion a big no-no because each cookie has to be present in e.g. the privacy page of an application.. which has to be approved by (sometimes) multiple (even external) stakeholders...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would localStorage be any better? They are technically equivalent but are there any legal differences?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think so (but I'm no lawyer) - just as an example: https://www.3sat.de/datenschutz/cookies-und-local-storage-100.html

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's what I suspected as well. It basically boils down to the fact that the new subscription models that we're planning that are based on counting the number of daily active users will not be a good fit for all potential customers. Those customers will instead need to negotiate a custom subscription deal with us where pricing is based on other factors. But we will still assume daily active users as the basis for pricing will be a good match for many (or at least better than the number of named developers).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let me give a bit more context.

This cookie will be only generated/used by applications of Vaadin customers who use the new (non-yet-sold) subscription type.
It won't impact open-source Vaadin users in any way, nor customers with the existing subscriptions.

Additionally, this cookie doesn't carry any personal data of end-users, it's only used to know the number of daily users.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wouldn't that also mean that a single (and even small) DDOS attack would render my application useless because every anonymous user would count as DAU?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Limits are not applied immediately but evaluated during time, so a single peak will not prevent the application to work.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When you say it like this.. I've got a bad feeling that the DAUs aren't calculated in my application.. but somewhere in the cloud and my application requires access to the internet to send some statistics to your server.. instead of having the limit available in the license key/file so that it can be calculated offline.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Offline requirements is another reason for customers to opt for a model not based on DAU that I already mentioned. We're not making DAU the only option but we expect it to be the simplest and "fairest" option in enough cases to justify the development cost.

Offline calculation would make a bunch of other things more complicated (e.g. persistence, renewals, clustering, notifying owners for temporary overruns, grace periods). We might develop a solution for all those challenges later but we're starting with this simpler but not universally applicable approach.

@knoobie knoobie Aug 10, 2024 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Before we go overboard in this PR and highjack it even further: while I understand the reasoning behind the decision; it feels inappropriate for strict regulated customer like banks and so on where this would put your business modell at a disadvantage.. yes there are different license models.. but probably with a way higher costs compared to a 10-20 DAU license making Vaadin even less interesting for internal applications. We can discuss this in deeper detail at Vaadin Create in person!

At least my concern with the scope of the dependency could be fixed - which was way more important for me 🙂

@github-actions

github-actions Bot commented Aug 9, 2024 •

Copy link
Copy Markdown
Contributor

Test Results

1 132 files  + 3  1 132 suites  +3   1h 28m 22s ⏱️ + 1m 13s
7 347 tests +34  7 297 ✅ +34  50 💤 ±0  0 ❌ ±0 
7 679 runs  +31  7 619 ✅ +31  60 💤 ±0  0 ❌ ±0 

Results for commit 472fa9f. ± Comparison against base commit 432256d.

♻️ This comment has been updated with latest results.

@sonarqubecloud

sonarqubecloud Bot commented Aug 9, 2024

Copy link
Copy Markdown

@mshabarov
mshabarov merged commit 69967e9 into main Aug 12, 2024
@mshabarov
mshabarov deleted the feat/dau_support branch August 12, 2024 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants