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

Fixed Timer(timeInterval:,repeats:,block:) not accounting timeInterval for the first fire date. #196

Conversation

grigorye
Copy link
Contributor

@grigorye grigorye commented Dec 1, 2020

https://github.com/OpenCombine/OpenCombine/blob/master/Sources/OpenCombineFoundation/Helpers/Portability.swift#L58-L64

It looks like this was a typo/something overlooked, but basically, this fire: Date() breaks at least every timer publisher like Timer.publish(every: timeInterval, on: .main, in: .default), as it basically results in the first event fired immediately vs in timeInterval. (Just in case, no, Combine does not fire that extra event).

@codecov
Copy link

codecov bot commented Dec 1, 2020

Codecov Report

Merging #196 (adf5308) into master (5436868) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #196   +/-   ##
=======================================
  Coverage   97.30%   97.30%           
=======================================
  Files          98       98           
  Lines        6649     6654    +5     
=======================================
+ Hits         6470     6475    +5     
  Misses        179      179           
Impacted Files Coverage Δ
...es/OpenCombineFoundation/Helpers/Portability.swift 93.68% <100.00%> (+0.35%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5436868...adf5308. Read the comment docs.

@OpenCombineBot
Copy link

LGTM

Generated by 🚫 Danger Swift against adf5308

@broadwaylamb broadwaylamb self-requested a review December 1, 2020 10:07
Copy link
Member

@broadwaylamb broadwaylamb left a comment

Choose a reason for hiding this comment

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

Uh-oh. Thank you for catching this!

@MaxDesiatov MaxDesiatov merged commit 3d61bf8 into OpenCombine:master Jan 29, 2021
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

Successfully merging this pull request may close these issues.

None yet

4 participants