Altair: Add ability to configure history depth

Created on 19 Jun 2020  路  8Comments  路  Source: imolorhe/altair

Now, Altair keep 7 previous queries in history http://screenshot.lvcdn.ru/3a8eab1545.png but often its too few for developing purposes. I think, that its has not any reason against to increase history size up to 100 on more records.

Also, it may be great feature, keep query datetime and shown it near every query in history

Most helpful comment

Fair enough. I'll create a new setting for the history depth in the settings pane.

All 8 comments

Hey @XAKEPEHOK :wave:,

Thank you for opening an issue. We will get back to you as soon as we can.
Also, check out our Open Collective and consider backing us - every little help counts!

Hey @XAKEPEHOK, is this with the browser extension or the desktop application? There's a limit of 7 history items for the browser extensions/web app, but the limit in the desktop applications is 50. The reason for the limit is because of storage space.

Altair stores its data using local storage, and browsers have different limits to the amount of local storage space a domain can have. So the limit on the history is to prevent the history items from using too much of the limited storage space, which would otherwise be useful for other more vital features in the application.

Yes, I tell about browser extension. Chrome/Safari/Firefox provide up to 5 MB for localstorage data. In my experience, real graphql queries rarely exceed 1KB. Ok, for too big queries (I think it may be only in poorly-designed graphql backends) it may be bigger, up to 5KB for 1 query.

5 KB * 100 = 500 KB. Its less than 10% from 5 MB limit

Another way, Altair can limit not quantity of history records, but size of history in bytes, like localstorage.get('history').length

@XAKEPEHOK You're forgetting that the history limit is per window 馃檪 Imagine you're working on a collection of queries, and you have 7 windows open. You would hit the 10% usage (500kb) with 14 items in your history.

Also I don't think history should be using up to 10% of the storage. Maybe 5-7% storage is fine though. There are a lot more things that share the storage and are more important (in the list of features) than having a large amount of history items (the introspection data per window can run into megabytes and you can agree that is more important).

I agree with increasing the limit to 15 items though, I'm not yet convinced increasing it beyond that would be worth it.

Yes, I forget about windows. But I think, that limit of 5-7% optionally (in settings) may be applied to all history in all windows.

May be frontend developers doesn't need many records in history, because they often use "ready to use and tested graphql API", but for me, as backend developer, really need more history records, because backend developers build graphql API itself, testing it after every change (manually at development process) and often make bugs & bugfixes, that can make new bugs :) Its iterative process, that often need re-testing of some previous queries.
For example: CRM system has orders, that can be accessed in graphql. OrderType is very complexity type, that has many-many fields and relations, and ofcourse, users want to be able find this orders by many criterias, passed in args. CRM may contain hundreds of thousands orders and very complexity search criterias, that can be resolved by something like ElasticSearch. IMHO, that ElasticSearch is not so user-frendly (like sql or mongodb), and while I developing & testing my elastic query builder I make many-many queries with different "criteria params" in args, that create many overwritten history records. 15 is better that 7 :) but also too few

Okay, can we come to a compromise then? What amount would be sufficient? Also can't you use the desktop apps? 馃

What amount would be sufficient?

50 or more

Also can't you use the desktop apps?

It my personal preference. Of course, I can, but all installed browser extension synced with all my workstations (home, office, laptop) and always has up-to-date version, because browser update all extensions in background

Fair enough. I'll create a new setting for the history depth in the settings pane.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bsr203 picture bsr203  路  12Comments

trafficfox picture trafficfox  路  8Comments

benhutton picture benhutton  路  10Comments

imolorhe picture imolorhe  路  3Comments

aoudiamoncef picture aoudiamoncef  路  5Comments