Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • S Solaar
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 10
    • Issues 10
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pwr-Solaar
  • Solaar
  • Merge requests
  • !1953

Filter and escape technical detail fields

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/mbway/set_text_fix into master Jan 02, 2023
  • Overview 2
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: mbway

when running solaar with verbose logging I found the message was being emitted:

(solaar:64699): Gtk-WARNING **: 17:18:05.225: Failed to set text '<small><tt>Path         : /dev/hidraw5
Index        : 255
Product ID   : 046d:C092
Protocol     : HID++ 4.2
Polling rate : 1 ms (1000Hz)
Serial       : 
Unit ID      : 1D002800
  Bootloader : BL1 17.00.B0005
  Firmware   : U1  52.00.B0010
  Firmware   : ' from markup due to error parsing markup: Error on line 10 char 25: Element “markup” was closed, but the currently open element is “tt”

After investigation, I found this was because my G203 mouse was returning the following firmware values:

>>> device.firmware
(FirmwareInfo(kind=NamedInt(1, 'Bootloader'), name='BL1', version='17.00.B0005', extras=b'\xaa\xfd'),
 FirmwareInfo(kind=NamedInt(0, 'Firmware'), name='U1 ', version='52.00.B0010', extras=b'\xc0\x92'),
 FirmwareInfo(kind=NamedInt(0, 'Firmware'), name='\x00\x00\x00', version='00.00', extras=None),
 FirmwareInfo(kind=NamedInt(3, 'Other'), name='', version='', extras=None),
 FirmwareInfo(kind=NamedInt(3, 'Other'), name='', version='', extras=None))

Specifically the null characters in one of the firmware name fields was 'ending' the string early. Because of this the technical details are not fully filled out. After this fix the details were displayed. I also think that it makes sense to not display empty fields so I filtered those out to get the following:

(left to right: before, with null fix, with null fix + filtering) ui

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/mbway/set_text_fix