Tuesday, July 19, 2022

Mojito is broken due to Mint UI overhaul

Hi All,

tl;dr
If you are wondering why Mojito no longer works, it's because of the new Mint user interface.

Details:
Around the beginning of 2022, Mint started automatically switching users over to a new user interface (UI). The new UI has a completely different programming interface (API) which effectively breaks Mojito. So any users that have the new Mint UI can no longer use Mojito to fetch and update their Mint data. My account was finally converted to the new UI a few weeks ago (I think I was one of the last?), so Mojito is broken for me, too.

My goal is to update Mojito so it will work with the new Mint UI, but I can't say with any confidence when that will be. My life and responsibilities are very different than they were when I originally created Mojito in 2013. Things are super busy for me right now. I'm sure many of you can relate to that overwhelming feeling where choosing to work on one thing means that something else is not getting done. That's my situation right now. Unfortunately, Mojito is not one of the projects where you can spend 15 minutes on it here and there. It requires several hours at a time, which is usually only possible late at night. And, I don't know about you, but I am already feeling pretty tired lately.

Again, I really do want to get Mojito working again, both for myself and for the handful of dedicated users out there. I just don't want to give you any false expectations about when that will happen.

Cheers,
-b3

28 comments:

  1. Any sort of donation help? Maybe 100 from me and a few others? Just an idea.

    ReplyDelete
  2. i am one that contributed steady, just because mojito is a wonderful tool. It is a good idea to create a pool of donors as most of us use mojito regularly. We tip at the restaurant 5-30 dollars without blinking. Hopefully he will get the wisdom to fix this issue (and futures issues also)

    ReplyDelete
  3. Thanks for the thoughtful offer @EspElement. Unfortunately it won't help speed things up. The problem isn't a lack of motivation, it's just being able to find spare time. I *have* started looking into it, but reverse engineering the Mint API and then trying to get the requests to work from Mojito takes a lot of time. Baby steps ...

    ReplyDelete
  4. Anxiously awaiting this to be working again! Thanks for the support over all these years!

    ReplyDelete
  5. Thank you for all you've done with Mojito over the years. I've loved using it and will wait patiently in hopes that you can eventually getting it going again. I'm also happy to contribute as a thank you!

    ReplyDelete
  6. Hi All. I was able to work on Mojito this past week. After a few late nights, progress is being made! Hopefully I will be able to keep chipping away at it and have the new version of Mojito available for download in the next 3 or 4 weeks (?).

    ReplyDelete
  7. For those who would like to play with a partially working "alpha" release, you can download a new copy of Mojito and modify it to use the new "MojitoLib2" library. Here's how to do that.

    1. Open the script associated with the Mojito spreadsheet --> Select "Extensions" > "Apps Script" from the menu at the top. If prompted, use the new Apps Script editor.
    2. Under the Libraries section on the left, click the three dots next to the "MojitoLib" library, and select "Remove".
    3. Click the "+" next to the Libraries section to add the new MojitoLib2 library. In the "Add a Library" window, fill out the fields as follows.

    Script ID: 1HMD3ffKSWzpJkEOtazTnonBgeUfxtBJa7mI0hk5wabGIlyMPA3pPMftp
    (then click "Look up")
    Version: (whatever the latest version is)
    Identifier: MojitoLib (remove the "2" at the end)

    4. Then click "Add", and close the "Mojito scripts" window.

    Now open a new browser tab and navigate to Mint.com. Open the Developer Tools window and go to the Network tab, as before. Instead of filtering for "track.xevent", you now need to filter for "/v1/user". Similar to the previous procedure, after logging in to Mint.com, select the "user" row in the Developer Tools window, click in the Headers section on the right, select all header data (Ctrl+A) and copy it (Ctrl+C). No need to copy separate "Payload" data any more. Now, go back to Mojito and open the authentication window (i.e. select "Mojito" > "Connect Mojito to your active Mint session" menu item). Paste in the HTTP headers you copied (Ctrl+V) and click OK.

    You should now be able to download transactions and account balances.

    IMPORTANT NOTES:
    * This is an "alpha" release. You should expect to run into things that are broken.
    * All that works right now is importing transaction and account balances. You can't choose "Sync all with Mint" because it will probaby fail (I haven't tested it). Also, the data in the "Categories" and "Tags" tabs are not sync'ed yet, and you can't save transaction changes back to Mojito yet.
    * You must currently replace all existing data when you import account balances (i.e. check the box to replace existing balances). If you don't, the import will probably fail or the new balances / accounts won't merge together correctly.

    ReplyDelete
    Replies
    1. Just updating my results:
      1-i can connect to my mint account using "/v1/user"
      2- when i hit "sync all with mint" i receive "Exception: The number of rows in the range must be at least 1."
      3-mojito import TxnData as expected

      Also, i tried to start with a fresh copy of mojito, same results

      THANKS THANKS THANKs for your work/intentions

      Delete
    2. Read the second bullet point under IMPORTANT NOTES. ;-)

      "Sync all" doesn't work yet. You can only import transactions and import account balances. For importing account balances, you must always "replace existing" balances.

      Delete
  8. This comment has been removed by the author.

    ReplyDelete
  9. Alpha release version "9" is now available. "Sync All" no longer fails outright, but there are still bugs I still recommend only using "Import Txn Data" and "Import account balances".

    ReplyDelete
  10. Alpha release version "10" is now available. Account balance import should work as expected now. You no longer have to check the "replace existing" checkbox every time. Category import (part of "sync all") is still borked.

    ReplyDelete
  11. Alpha release version "11" is now available. Category import has been fixed, so "sync all" should fully work now. Saving of edited transactions doesn't work yet. That's next.

    ReplyDelete
  12. Alpha release version "12" is now available. You can now save edited transactions (avoid split items though, they haven't been fully tested). Also some small bug fixes.

    ReplyDelete
    Replies
    1. I deleted a Mint account and re added them, and now it wants to fill 0 into the sheet on those. Not sure if this is an error or not? Maybe I should delete those columns and let it recreate them? Thanks!!

      Delete
    2. I tried deleting the column just recreates it. Claims it has "no history for this account". Not sure why that would be. Maybe it is an error on Mints side? I deleted it then remade it, maybe Mint is not filling them properly?

      Delete
    3. I'm not sure exactly what's happening there. If you removed the old accounts from Mint and re-added them, then the internal account ID for the accounts probably changed. So the account columns in Mojito probably didn't align anymore with the re-added Mint accounts. I'm kind of surprised Mojito is re-creating the columns for the deleted accounts, though. I'd have to see the debug log to understand what is happening during the import. http://b3devs.blogspot.com/p/more-qna-10x.html#enable_debug_logging (if there are sensitive account names, or anything else, in the debug log, feel free to rename them in a text editor before sending the log to me.)

      Delete
  13. Wow this is great, I will get started on trying it again. I will be putting out a nice donation here soon hopefully. Cheers!!

    ReplyDelete
    Replies
    1. I deleted PayPal and Venmo. Can I send you a donation to a crypto address?

      Delete
    2. Sorry. I don't have a crypto address. No worries! Happy New Year!

      Delete
    3. Ah dude. It is easy to make. Just make one and I can send you something. I want to contribute to your awesomeness.

      Delete
  14. When trying to sync transaction data or account data, I get the following error: TypeError: Cannot set properties of undefined (setting 'Const')

    I was using alpha release 21 so I updated to the most recent release (22) in case that was the issue, but I still get that error.

    Any idea of what the issue might be?

    Thanks!

    ReplyDelete
    Replies
    1. Google has been auto-migrating Apps Script projects to the "V8" JavaScript runtime engine, which is causing problems for the MojitoLib library. Thankfully there is an easy fix (for now). You can switch back to the old "Rhino" runtime.

      To do this, open the Apps Script for your Mojito spreadsheet (i.e. select the Extensions > Apps Script menu item). Select the gear icon on the left to view the Project Settings, then *uncheck* the "Enable Chrome V8 runtime" option. Then, switch back to the Mojito spreadsheet and try the sync again. It should start working again.

      Delete
    2. Now Edge has been updated to where we cannot copy the entire cookie set like we did before. As discussed in the email, Chrome already did this and I was expecting the chromium types to catch up. I am not sure how to copy each one individually either if I wanted too. Thoughts on that?

      Delete
  15. The latest version of Chrome (113.0.5672.129) you can no longer "Select All" to copy all of the http request headers. It's super annoying that Google removed that simple feature! However, there is a "Copy" item in the context menu when you right-click the "/pfm/v1/user" request on the left side of the DevTools window. The Copy menu item opens a sub-menu with several ways to copy the request. Turns out that the "Copy as Node.js fetch" option copies the request data in a format that Mojito can parse (as of version 22). Soooo ... If you update your Mojito copy to use version 22 of the MojitoLib library, you can start using the "Copy as Node.js fetch" option to copy the necessary headers for Mojito.

    I know I need to update the "authentication steps" page. I just haven't had time to do it.

    ReplyDelete
    Replies
    1. Brilliant. Thank you so much for supporting this continually! Working fine for me!

      Delete