go-lark / lark

An easy-to-use SDK for Feishu and Lark Open Platform (Instant Messaging API only)
https://go-lark.github.io/
MIT License
199 stars 30 forks source link

feat: improve StartHeartbeat #34

Closed wfxr closed 2 years ago

wfxr commented 2 years ago

Hi @crispgm , I also encounterd the #28 issue. The manually GetTenantAccessTokenInternal(true) call can be avoid if we do the first call in blocking mode. It's a common pattern to init and refresh a resource.

Closes #28

crispgm commented 2 years ago

@wfxr The CI crashed because of workflow's configuration, would you mind rebasing main branch with git pull origin main --rebase and push again?

In my local environment, the heartbeat tests failed.

wfxr commented 2 years ago

@wfxr The CI crashed because of workflow's configuration, would you mind rebasing main branch with git pull origin main --rebase and push again?

Done.

wfxr commented 2 years ago

@crispgm ci still failed by insufficient test environment 🤔

crispgm commented 2 years ago

@crispgm ci still failed by insufficient test environment 🤔

I have no idea with workflow's syntax on secrets. But my local tests failed:

=== RUN   TestHeartbeat
    api_auth_test.go:41: 
            Error Trace:    api_auth_test.go:41
            Error:          Not equal: 
                            expected: 2
                            actual  : 1
            Test:           TestHeartbeat
    api_auth_test.go:44: 
            Error Trace:    api_auth_test.go:44
            Error:          Not equal: 
                            expected: 2
                            actual  : 1
            Test:           TestHeartbeat
    api_auth_test.go:48: 
            Error Trace:    api_auth_test.go:48
            Error:          Not equal: 
                            expected: 3
                            actual  : 1
            Test:           TestHeartbeat
--- FAIL: TestHeartbeat (6.21s)
FAIL
exit status 1
FAIL    github.com/go-lark/lark 7.716s
wfxr commented 2 years ago

@crispgm I did some modification to the testing machanism. Now it should be passed.