-
Notifications
You must be signed in to change notification settings - Fork 0
Implement metadata only parsing for Items #8
Comments
With multiple queue loading allowed now, this issue is more important as load times now exceed 10 seconds. |
Also, Sundeep wants a Jester loader. |
This is waiting for a code review. |
Header Only ParsingIn pull request #113, this issue was addressed by modifying the arguments for
This was done by modifying which attributes of the Item class in def __init__(self, queue: str, number: int, wholeItem: bool) -> None:
# Code was intentionally omitted here for relevancy
if wholeItem: self.content = self.__parseSections() The entirety of the item content, which is stored in |
This functionality has been modified and extended. ECNQueue ModuleBoth Items and Queues has an argument in their constructor called Examples: import ECNQueue
# Create an Item with content
item = Item("ce", 100)
# Create an Item without content
item = Item("ce", 100, headersOnly=True)
# Create a Queue with content
queue = Queue("ce", headersOnly=False)
# Create a Queue without content
queue = Queue("ce") APIIn the API, the Item and Queue constructors are used with the same defaults and customization options. A client can control this option using a URL's query string. Examples: # Request an Item with content
curl 'localhsot:5000/ce/100'
# Request an Item without content
curl 'localhsot:5000/ce/100?headersOnly=True' This is parsed in the API using the Examples: from flask import Flask, request
from flask_restful import Api, Resource
import ECNQueue
# Create Flask App
app = Flask(__name__)
# Create API Interface
api = Api(app)
# Create a Flask RESTful Resource for dealing with Items
class Item(Resource):
# Create a method to handle HTTP GET requests
def get(self, queue: str, number: int) -> str:
# Parse a boolean value from the query string using Flask's request object
headersOnly = True if request.args.get("headersOnly") == "True" else False
return ECNQueue.Item(queue, number, headersOnly=headersOnly).toJson()
# Add the Item resource to routing
api.add_resource(Item, "/api/<string:queue>/<int:number>")
if __name__ == "__main__":
app.run() |
Next steps are to merge this into staging and update the frontend' logic. This should happen after #123 |
This does not depends on #123 and can be merged into the UI now. |
After introducing the ItemProvider component to consolidate item management, a regression has been introduced causing recursive variable setting. The particular issue occurs when ItemView's The routing logic needs to be memoized to avoid this issue.
|
The above issue with successive state has been fixed by no longer setting state in the ItemView Route. Instead the item lookup has been broken into two parts. First the existing ItemTable onClick behavior has not been modified and will append That same data is also passed to the ItemView component where it is used to query the API for the full item and set state. There are still some unsynced UI elements that need updated for this to be an elegant solution but it is functional. Moving forward, ItemTable's performance will need to be addressed as it is the bottleneck due to it re-rendering on every interaction. |
Currently, when an Item is loaded, all of its contents including its body are parsed. As more features such as attachment parsing are added, this could slow down the loading of the ItemTable in the UI by:
This could be addressed by implementing a function that only loads information needed to display in the ItemTable and waiting to load the rest of the item until it is requested in the ItemView.
The text was updated successfully, but these errors were encountered: