-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
Refactor code with service to improve readability and testing, simplify msg #199
Comments
May I ask you what you mean with "service" in your list above? |
I will explain well this in the code documentation. A service is struct that implements a shared interface. Let's take the example of the SMTP service. There is a trait pub trait SmtpServiceInterface {
fn send(&mut self, msg: &lettre::Message) -> Result<()>;
} Functions that need the service accept in parameter a |
Basically, the main structure is on master (I'm quite satisfied of the result, let's see the benefits of it when we will add new tests). I still need to fix some part that I commented, to fix existing tests then we can start testing the rest (#198). |
Nice! |
It seems that our last merge broke more stuff than I thought, I discovered a lot of tiny issues I'm fixing over time. Also, the Vim plugin is totally broken, since the JSON API of the |
Oh... sorry about this ._. |
Oh no no, don't be sorry, I'm as faulty a you because I also approved and merge the branch. I should have tested more before merging. I let you know when the code will be ready to be tested 😉 |
I had a long thought last night on the code (especially about the
Beside all this:
Let me know. |
Hm... I can understand what you mean. I'm a little bit irritated why you're still using an additional struct for creating templates? I thought that you would also use
Well yes,
But we could "fix" those issues by applying more PRs to them (or I'm just blind and I pointed to the wrong structures...).
Well, I had to experience in my work placement as well, that comments are seen as useless as well... so it's fine for me, if we reduce them. |
It is exactly what the
First, I don't see how it prevents you to keep a local cache in the TUI code (let's say a What I suggest is to implement a cache within the TUI code. When the
I was more talking about
Well, in a lib it is not useless at all. When the aim of your lib is to be used by other developers, examples are a must I would say. I'm not against, it's just not fitting a CLI. |
I'm not such a fan of holding a connection for so long. For you cli-usage it's fine since each operation will take only some seconds but imagine someone else is using the TUI and let it open for hours. I think the server wouldn't be happy about this.
That's actually a neat idea! But I'd have to fetch everything again, if the user restarts the TUI 🤔
This would be neat! I think that I'll join ^^
Oh I see, it looks pretty nice. I think we can switch to this.
ok |
Well, how do you think mail clients do? I would not be surprised if they keep the connection open. Thunderbird is not reconnecting each time I do an action, so they must keep the session somehow. In fact IMAP session are timed out, so it's not a problem to keep it open until it times out. If the user does an action after a while, we just need to check if the connection is still alive. If not then reconnect and go 😃
You can save state in files. It is what I'm gonna do for the IMAP sync lib/CLI. |
Wouldn't it be better to use a database due to performance reasons? |
Well, first it is a temporary solution the time for us to develop the IMAP sync lib. Secondly, I don't think we will have perf issue. You will parse it only once when you start the TUI so it's fine! |
Hey @TornaxO7, I have some news (finally... I had hard times at work and I was not able to keep some free time for the tool):
I propose the following:
I really hope you will not take badly this refactor, since it touched a lot to your previous PR on the message refactor. I see your PR more like a "boost" that Himalaya needed to go forward. Many concept and ideas have been changed, but a lot have been kept also 😉 |
I'm fine with this. I'm a little bit busy at the moment due to my NintendoDS emulator which is my main project at this moment also my first semester just started and I'm pretty excited how it'll be :D I'll try to help you with the other issues, if I'll find some time. Thank you for your time investment 👍 |
Thanks for the time you spent on Himalaya, you are so far the best contributor! Good luck with your project and semester 😃 |
error-chain
byanyhow
[c619f06] Use state-of-the-art error library #152 Error handling refactoring. TornaxO7/himalaya#16Config
andAccount
management + repository Discussion aboutmail_refactor
TornaxO7/himalaya#9The text was updated successfully, but these errors were encountered: