question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

to track or not to track

See original GitHub issue

hi guys

i came across a use case where pausing and resuming the tracking of state paths would be beneficial.

usecase

imagine a table with multiple rows which supports the following features (simplified for now):

  • sorting
  • inplace editing of the cells

now imagine we have the following table sorted by column Name:

Id    Name
1     Anthony
2     Beat

lets say our state that holds the rows looks like:

myRows:
{
1:{Id:1,Name:"Anthony"},
2: {Id:2, Name:"Beat"
}

after rendering the tracked paths will contain:

myRows.1
myRows.1.Name
myRows.2
myRows.2.Name

(because the sorting method accessed those paths)

now inplace editing the table to:

Id    Name
1     Christian
2     Beat

will result in the table to be immediately flipped over to:

Id    Name
2     Beat
1     Christian

because of the sorting

This is not a good user experience. What i would like is that the sorting just happens after explicitly clicking on the column header and not right after editing a cell.

if i now could something like

app.pauseTracking()
dotheSortingThingy()
app.resumeTracking()

those paths wouldn’t be tracked and my use case would be fine 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
etienne-dldccommented, Nov 8, 2018

Hi 👋

About the proposal

I don’t think this is a good idea, mainly for two reasons:

1 - Path tracking is an implementation details

The notion of Path Tracking is not something the user (user === dev using overmind) is supposed to know about, it’s how we do it but not how we present it to the user.

2 - This could lead to serious bug way too easily

What if the user forget to call resumeTracking ? What if you use a library and call some of it’s stuff while the path tracking is paused ?

About the use case

IMO, you are using the wrong state here. Either you decide that your rows are sorted by name (with a currentSortCriteria state), in that case they are sorted at all time (and I agree with you it’s not a great UX when the user update something), or you want the re-order to happend only when the user click the header and in that case you need an state that store the order of the row and not the criteria.

So in my opinion the simplest solution to this is to add a order state that would store the order of the colum at any point in time. Then clicking on a column header would update that order state using the values when the user clicked and this state would not change until the user click on another header.

0reactions
fopsdevcommented, Jul 2, 2019

Just for completeness sake. I have an action now which creates the new sorted rows (ids) whenever a user changed the filter or whenever the user changes the sorting. this sorted rows is also saved in state giving nice insights using devtools. the components just point to this sorted rows and just update fine now when the user really is requesting it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

If an app asks to track your activity - Apple Support
Go to Privacy settings to see a list of apps that requested to track your activity. On iPhone, iPad, or iPod touch, go...
Read more >
What does 'Ask App Not to Track' mean? - 9to5Mac
This usually means sharing/selling the data on to ad networks. If you press 'Ask App Not To Track', the app will not be...
Read more >
To Be Tracked or Not? Apple Is Now Giving Us the Choice.
When we select “Ask App Not to Track,” two things happen. The first is that Apple disables the app from using an Apple...
Read more >
How to use iPhone's new 'Ask App not to Track' option to ...
Here's an even better idea: You can adjust one setting that tells all apps not to track you, so you won't keep being...
Read more >
Former Apple Engineer Says iPhone Privacy Initiative Is a 'Dud'
Former Apple engineer says the button on iPhones asking apps not to track you is a 'dud' that gives users a 'false sense...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found