(oref waveobj.ORef)
| 106 | } |
| 107 | |
| 108 | func SendWaveObjUpdate(oref waveobj.ORef) { |
| 109 | ctx, cancelFn := context.WithTimeout(context.Background(), 2*time.Second) |
| 110 | defer cancelFn() |
| 111 | // send a waveobj:update event |
| 112 | waveObj, err := wstore.DBGetORef(ctx, oref) |
| 113 | if err != nil { |
| 114 | log.Printf("error getting object for update event: %v", err) |
| 115 | return |
| 116 | } |
| 117 | wps.Broker.Publish(wps.WaveEvent{ |
| 118 | Event: wps.Event_WaveObjUpdate, |
| 119 | Scopes: []string{oref.String()}, |
| 120 | Data: waveobj.WaveObjUpdate{ |
| 121 | UpdateType: waveobj.UpdateType_Update, |
| 122 | OType: waveObj.GetOType(), |
| 123 | OID: waveobj.GetOID(waveObj), |
| 124 | Obj: waveObj, |
| 125 | }, |
| 126 | }) |
| 127 | } |
| 128 | |
| 129 | func ResolveBlockIdFromPrefix(ctx context.Context, tabId string, blockIdPrefix string) (string, error) { |
| 130 | if len(blockIdPrefix) != 8 { |
no test coverage detected