profile
viewpoint
Dave Gramlich callmehiphop Detroit, MI I like things.

callmehiphop/angular-namespacer 31

Namespaces your Angular modules!

callmehiphop/pb-util 25

Utilities for working with common protobuf types

callmehiphop/console-time 16

console.time & console.timeEnd polyfill

callmehiphop/karma-background 12

Easily run Karma as a background process

callmehiphop/backend 11

No API? No problem!

callmehiphop/rip-subtitles 11

Rip embedded subtitles from video files.

callmehiphop/hey 8

pub/sub abstraction layer for AngularJS to make managing your events easier

callmehiphop/video-screen 6

take screenshots at any point during a video

callmehiphop/angular-backend-when 3

`$httpBackend` wrapper to clean up declaring routes/responses for e2e testing

issue closedcallmehiphop/pb-util

struct.decode with empty listValue raises "Cannot read property 'map' of undefined"

Hello :D ! I've had an issue running struct.decode with empty lists generated by the same Python lib mentioned in #13 . Here's an example:

{ "fields": { "test": { "listValue": {} } } }

It raises the following exception at line https://github.com/callmehiphop/pb-util/blob/master/index.ts#L209

Cannot read property 'map' of undefined

I've tested changing the line https://github.com/callmehiphop/pb-util/blob/master/index.ts#L208 of pb-util to the following and it seems to resolve the issue:

decode({values = []}: ListValue): JsonArray {

closed time in 7 days

Leinvedan

issue commentcallmehiphop/pb-util

struct.decode with empty listValue raises "Cannot read property 'map' of undefined"

I just published a patch release (v1.0.3), so this should be resolved now. Let me know if the issue still persists somehow and thanks again for the contribution!

Leinvedan

comment created time in 7 days

release callmehiphop/pb-util

v1.0.3

released time in 7 days

push eventcallmehiphop/pb-util

Dave Gramlich

commit sha a62fa91cdcf544b967303c8b78f6e4fcc94c9c94

1.0.3

view details

push time in 7 days

created tagcallmehiphop/pb-util

tagv1.0.3

Utilities for working with common protobuf types

created time in 7 days

pull request commentcallmehiphop/pb-util

fix(struct): handle empty listValue

With tests too!!! 😍 Thank you!

Leinvedan

comment created time in 7 days

push eventcallmehiphop/pb-util

Pedro Lemos

commit sha 06ef9117671347e0cdb9571a9e18ce7d1ae79267

fix(struct): handle empty listValue (#16)

view details

push time in 7 days

PR merged callmehiphop/pb-util

fix(struct): handle empty listValue

Solution for issue #15

+6 -1

0 comment

2 changed files

Leinvedan

pr closed time in 7 days

issue commentcallmehiphop/pb-util

struct.decode with empty listValue raises "Cannot read property 'map' of undefined"

Thanks for the report, @Leinvedan! The fix looks good to me and I'd be happy to accept a PR if that's something you're interested in, otherwise I can get this done pronto.

Leinvedan

comment created time in 7 days

starteddragonman225/curved-arrows

started time in a month

startedGraphQLGuide/book

started time in a month

startedtldraw/tldraw

started time in 2 months

startedtldraw/core

started time in 2 months

startedpublic-apis/public-apis

started time in 2 months

release callmehiphop/pb-util

v1.0.2

released time in 2 months

issue commentcallmehiphop/pb-util

struct.decode raising "TypeError: Cannot convert undefined or null to object"

Just published v1.0.2, please let me know if the issue persists!

Leinvedan

comment created time in 2 months

created tagcallmehiphop/pb-util

tagv1.0.2

Utilities for working with common protobuf types

created time in 2 months

push eventcallmehiphop/pb-util

Dave Gramlich

commit sha 3b74d2991e5b1a7def98766e05246af95986d138

1.0.2

view details

push time in 2 months

delete branch callmehiphop/pb-util

delete branch : no-fields

delete time in 2 months

push eventcallmehiphop/pb-util

Dave Gramlich

commit sha b07afcd27db448e2396c979ffeb9f378e0c11b99

fix(struct): handle undefined fields (#14)

view details

push time in 2 months

PR merged callmehiphop/pb-util

fix(struct): handle undefined fields

Closes #13

+6 -1

0 comment

2 changed files

callmehiphop

pr closed time in 2 months

issue closedcallmehiphop/pb-util

struct.decode raising "TypeError: Cannot convert undefined or null to object"

Hello! I've been having problems with the struct.decode method, here's what i did:

I used the parseDict from google.protobuf.json_format(python 3.8) to convert the following payload to a protobuf Struct:

{'channel': 'desktop', 'context': {}}

The payload is received by a nodejs app which uses the struct.decode method, however it raises an error:

Received Payload

{
  fields: { 
      context: { 
          structValue: {}
      },
      channel: { 
          stringValue: 'desktop' 
      }
   }
}

Exception

TypeError: Cannot convert undefined or null to object

I've analysed the pb-util code and found out that, using this payload, there's a moment when the variable fields inside the struct.decode is undefined, resulting in the exception.

closed time in 2 months

Leinvedan

issue commentcallmehiphop/pb-util

struct.decode raising "TypeError: Cannot convert undefined or null to object"

hey @Leinvedan, thanks for reporting the issue. I just opened a PR to fix this.

Leinvedan

comment created time in 2 months

PR opened callmehiphop/pb-util

fix(struct): handle undefined fields

Closes #13

+6 -1

0 comment

2 changed files

pr created time in 2 months

create barnchcallmehiphop/pb-util

branch : no-fields

created branch time in 2 months

more