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.

How to use SINCE on time level not just date level

See original GitHub issue

check the code in Connection.js searchargs += modifier + criteria + ' ' + args[0].getDate() + '-' + MONTHS[args[0].getMonth()] + '-' + args[0].getFullYear();

It is possible to update it on date-time level?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mscdexcommented, Mar 3, 2016

uidvalidity itself doesn’t have any particular meaning, you just need to make sure it’s still the same value before you go to search on the last saved UID. If it’s different, you cannot assume the UIDs in the mailbox are still the same (the IMAP specification says servers “should not” ever change this unless absolutely necessary so chances are it probably will never change, but it’s best to be ready just in case).

So some pseudo-code might look like:

connect()
box = openbox()
if lastuidvalidity is empty or lastuidvalidity is not box.uidvalidity or lastuid is empty {
  lastuidvalidity = box.uidvalidity
  searchResults = search(since lastdate)
} else if lastuidvalidity is box.uidvalidity {
  searchResults = search(lastuid:*)
}
if searchResults.length > 0 {
  messages = fetch(searchResults)
  lastuid = getLargestUID(messages)
  lastdate = getLastDate(messages)
}

where lastuidvalidity, lastuid, and lastdate would be stored in some kind of permanent storage for use the next time you connect.

0reactions
johnzhou2011commented, Mar 3, 2016

thanks a lot! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

For or Since: What Is the Difference? - VOA Learning English
One common problem that English learners face is how to use “prepositions of time,” or prepositions that communicate time or direction.
Read more >
Since and for - cause or elapsed time - Linguapress
Rule 1. Since must imply cause, not time, when a since clause contains a present tense,.
Read more >
For Since Difference - When to use For and Since in English
The use of SINCE​​ It refers to when things began. Since + a point in time (in the past), until now. I've been...
Read more >
When (time and dates) | LearnEnglish - British Council
We use phrases with prepositions as time adverbials: We use at with: clock times: at seven o'clock, at nine thirty, at fifteen hundred...
Read more >
FIXED Level of Detail Expressions - Tableau Help
Click Days Since First Purchase on Columns and choose Continuous. Drag Sales to Rows. Change the aggregation for Sales on Rows from SUM...
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