Skip to content

Bugfix webmaster queue #140

Merged
merged 14 commits into from
Feb 1, 2021
Merged

Bugfix webmaster queue #140

merged 14 commits into from
Feb 1, 2021

Conversation

benne238
Copy link
Collaborator

@benne238 benne238 commented Dec 3, 2020

No description provided.

@campb303 campb303 self-assigned this Jan 5, 2021
@campb303 campb303 added api bug An issue that results in webqueue2 breaking high-priority Needs immediate extra focus labels Jan 5, 2021
@campb303 campb303 added this to the v1-readonly milestone Jan 5, 2021
@campb303
Copy link
Collaborator

Attempted to test test the current live queue with:

if __name__ == "__main__":
    loadQueues()

but I got an error:
Screen Shot 2021-01-18 at 4 58 27 PM

This will need to be fixed before I can merge the code.

@campb303
Copy link
Collaborator

Attempted to test test the current live queue with:

if __name__ == "__main__":
    loadQueues()

but I got an error in graddb414:
Screen Shot 2021-01-19 at 9 29 18 PM

@campb303
Copy link
Collaborator

Cannot merge at this time. Breaks on aae55 in the live queue. A copy of aae55 is below:

CC: "Chynoweth, Brandon C" <bchynowe@purdue.edu>
Date: Wed, 27 Jan 2021 15:09:57 +0000
From: "Wunderlich, Daren K" <dwunder@purdue.edu>
Message-ID: <CH2PR22MB1781788936122DB6D972650CD8BB9@CH2PR22MB1781.namprd22.prod.outlook.com>
Subject: RE: Requirement for Wind Tunnel Computer
To: "aaesite@ecn.purdue.edu" <aaesite@ecn.purdue.edu>
Content-Type: text/plain; charset="utf-8"
X-ECN-Queue-Original-Path: /home/pier/e/queue/Attachments/inbox/2021-01-27/108-original.txt
X-ECN-Queue-Original-URL: https://engineering.purdue.edu/webqueue/Attachments/inbox/2021-01-27/108-original.txt
X-ECN-Queue-Attachment-1-Path: /home/pier/e/queue/Attachments/inbox/2021-01-27/108-attachment-1.bin
X-ECN-Queue-Attachment-1-URL: https://engineering.purdue.edu/webqueue/Attachments/inbox/2021-01-27/108-attachment-1.bin


@benne238
Copy link
Collaborator Author

Empty Content

The parser attempts to find the ending line and starting line of content within and item, storing the line numbers in respective variables: contentStart and contentEnd. When the content of an item is empty, the contentStart and contentEnd variables will either be equal to eachother, or sometimes, contentStart will be greater than contentEnd, which isn't logically possible, but does indicate empty content in an item. A simple fix just involves comparing the values of the variables with the following code:

        if contentEnd <= contentStart:
            blankInitialMessage = self.__initialMessageParsing([""])
            sections.append(blankInitialMessage)
            return sections

This snipet will call the __initialMessageParsing() function, passing a list with a single empty string (signifying empty content), which will then return an initial message dictionary with the content key having a value of [""].

benne238 and others added 6 commits January 31, 2021 17:27
commit d9942b9
Author: benne238 <benne238@purdue.edu>
Date:   Wed Jan 27 21:05:25 2021 -0500

    removal of debugging lines

commit 02ab227
Author: benne238 <benne238@purdue.edu>
Date:   Wed Jan 27 21:04:33 2021 -0500

    fix for accounting for empty content in messages

commit 610bc86
Author: benne238 <benne238@purdue.edu>
Date:   Tue Jan 12 15:23:52 2021 -0500

    removal of queueDirectory testing code

commit 30d9cfe
Author: benne238 <benne238@purdue.edu>
Date:   Mon Jan 11 14:30:01 2021 -0500

    implementation of blank content handling

commit 2bd362c
Author: Justin Campbell <campb303@purdue.edu>
Date:   Wed Dec 30 15:13:54 2020 -0500

    Update Python requirements to fix Flask_JWT_Extended and PyJWT conflict

commit 38445fe
Merge: 0fd6f0a c20b9b8
Author: Campbell, Justin <campb303@purdue.edu>
Date:   Tue Dec 15 21:55:33 2020 -0500

    Merge pull request #154 from ECN/enhancement-persistent-filters-and-sorting

    Enhancement persistent filters and sorting

commit c20b9b8
Author: Justin Campbell <campb303@purdue.edu>
Date:   Tue Dec 15 21:54:39 2020 -0500

    Minor formatting

commit 2cccad2
Author: Tyler Jordan Wright <wrigh393@w2vm1.ecn.purdue.edu>
Date:   Fri Dec 11 13:09:17 2020 -0500

    Set autoResetFilters to false in order to stop filters from resetting on data change.

commit d842e2c
Author: Tyler Jordan Wright <wrigh393@w2vm1.ecn.purdue.edu>
Date:   Wed Dec 9 11:08:19 2020 -0500

    disabled autoResetSortBy to allow for sorting to persist when data changes.

commit 0fd6f0a
Author: Justin Campbell <campb303@w2vm4.ecn.purdue.edu>
Date:   Thu Dec 3 20:13:58 2020 -0500

    Update UI Snapshot
@benne238
Copy link
Collaborator Author

benne238 commented Feb 1, 2021

Testing

The Bugfix-Webmaster-Queue branch was locally merged into staging and the loadQueues() function was tested against q-snapshot and the live queue and no errors were encountered. Furthermore the api calls were also tested on the locally merged branch against the live queue and no errors were encountered there either.

Copy link
Collaborator

@campb303 campb303 left a comment

Choose a reason for hiding this comment

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

See comments about explicit exception handling.

api/ECNQueue.py Outdated
try:
emailUser, emailDomain = self.userEmail.split("@")

except:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Be more explicit here. What error are you anticipating? Catch it by name. For example:

# Catching a divide by zero error.

try:
    num = 1 / 0
catch DivideByZeroError as e:
    print("Cannot divide by 0. Try again.")

@campb303 campb303 merged commit acaf76c into staging Feb 1, 2021
@benne238 benne238 deleted the Bugfix-Webmaster-Queue branch February 1, 2021 19:41
Sign in to join this conversation on GitHub.
Labels
bug An issue that results in webqueue2 breaking high-priority Needs immediate extra focus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Queues That Won't Load Additional info supplied by user Missing Info Parsing
2 participants