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

Repository GetCacheRequirements tag could be incorrect. #54

Open
levibostian opened this issue May 18, 2019 · 0 comments
Open

Repository GetCacheRequirements tag could be incorrect. #54

levibostian opened this issue May 18, 2019 · 0 comments

Comments

@levibostian
Copy link
Owner

While developing an app, I just ran into this scenario:

    class GetCacheRequirements(): PagedGetCacheRequirements(PAGE_SIZE) {

	    var pageNumber = 1

        override var tag: GetCacheRequirementsTag = "Get friends. Page number: $pageNumber"
    }

Problem is, when the repository changes it's requirements, the tag does not change. In this scenario, the tag gets set when the class is constructed which means that it will always has pageNumber == 1. But if I decide to do this:

this.requirements = GetCacheRequirements().apply { this.pageNumber = 2 }

This will result in the incorrect tag.

So, time to think about improving the tag here. Make sure the tag is generated dynamically each time it's needed. So, maybe make it a function? Add something to the docs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant